mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-03-10 09:20:04 +01:00
Fix off by one error in SIGHASH_SINGLE code. Resolves issue 292.
This commit is contained in:
parent
dece35e95c
commit
1d6a8c908c
1 changed files with 1 additions and 1 deletions
|
@ -850,7 +850,7 @@ public class Transaction extends ChildMessage implements Serializable {
|
|||
}
|
||||
// In SIGHASH_SINGLE the outputs after the matching input index are deleted, and the outputs before
|
||||
// that position are "nulled out". Unintuitively, the value in a "null" transaction is set to -1.
|
||||
this.outputs = new ArrayList<TransactionOutput>(this.outputs.subList(0, inputIndex));
|
||||
this.outputs = new ArrayList<TransactionOutput>(this.outputs.subList(0, inputIndex + 1));
|
||||
for (int i = 0; i < inputIndex; i++)
|
||||
this.outputs.set(i, new TransactionOutput(params, this, BigInteger.valueOf(-1), new byte[] {}));
|
||||
// The signature isn't broken by new versions of the transaction issued by other parties.
|
||||
|
|
Loading…
Add table
Reference in a new issue