mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-01-30 23:02:15 +00:00
Fix off by one error in SIGHASH_SINGLE code. Resolves issue 292.
This commit is contained in:
parent
dece35e95c
commit
1d6a8c908c
@ -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
|
// 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.
|
// 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++)
|
for (int i = 0; i < inputIndex; i++)
|
||||||
this.outputs.set(i, new TransactionOutput(params, this, BigInteger.valueOf(-1), new byte[] {}));
|
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.
|
// The signature isn't broken by new versions of the transaction issued by other parties.
|
||||||
|
Loading…
Reference in New Issue
Block a user