mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-12 02:05:53 +00:00
Fix Script.getNumberOfBytesRequiredToSpend for P2SH
It is a size of redeem script that should be taken into account, not a size of scriptPubKey
This commit is contained in:
parent
b2efb0ddc2
commit
55803b15ac
@ -459,7 +459,7 @@ public class Script {
|
||||
// for N of M CHECKMULTISIG redeem script we will need N signatures to spend
|
||||
ScriptChunk nChunk = redeemScript.getChunks().get(0);
|
||||
int n = Script.decodeFromOpN(nChunk.opcode);
|
||||
return n * SIG_SIZE + getProgram().length;
|
||||
return n * SIG_SIZE + redeemScript.getProgram().length;
|
||||
} else if (isSentToMultiSig()) {
|
||||
// scriptSig: OP_0 <sig> [sig] [sig...]
|
||||
// for N of M CHECKMULTISIG script we will need N signatures to spend
|
||||
|
Loading…
x
Reference in New Issue
Block a user