bitcoinjs-lib icon indicating copy to clipboard operation
bitcoinjs-lib copied to clipboard

SIGHASH_SINGLE | ANYONECANPAY input signed but can't update the unsigned inputs

Open elRaulito opened this issue 1 year ago • 1 comments
trafficstars

I created a psbts with the following inputs:

0 Coming from segwit timelock multisig script, signature SIGHASH_SINGLE | ANYONECANPAY
1 Placeholder that will be filled later

I sign 0 and works fine, however as soon as I try to update input 1 as follows

    psbtPartial.updateInput(1,{
      hash: "34466a1f38495b4bc7db5aa07168dddf2c304f535a604a3104a0b610b2b91fc9",
      index: parseInt(0),
      witnessUtxo: {
        script: p2sh.output,
        value: parseInt(30000),
      },
      redeemScript: p2shBorrower.redeem.output
  });

I get the error:

image

elRaulito avatar Feb 29 '24 16:02 elRaulito

Are you sure you don't mean to addInput?

junderw avatar Mar 01 '24 00:03 junderw

@elRaulito It's obvious that input1 doesn't exist, you should use addInput to add it

If you have no further questions I will close this PR

jasonandjay avatar Apr 30 '24 09:04 jasonandjay