hsd icon indicating copy to clipboard operation
hsd copied to clipboard

wallet batches may exceed policy weight limit

Open pinheadmz opened this issue 2 years ago • 1 comments

the reason is because as we are building the batch, we only account for ONE funding input:

https://github.com/handshake-org/hsd/blob/master/lib/wallet/wallet.js#L3851-L3866

If the user's wallet needs to spend more than one coin to pay the fee for a batch, this size estimator will be wrong and the final TX will break the rule.

We could for example maybe call coin selector during the batch process and see how many inputs we'll need to fund the batch and take that size into account -- but i think that would mean calling fund() too many times during batching.

pinheadmz avatar Oct 11 '22 16:10 pinheadmz

I was able to send 10 HNS from myself to myself (same wallet) and then send the sendbatch '[["REVEAL"]]' was able to sent within the next block.

nglabs42 avatar Oct 11 '22 17:10 nglabs42