3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-12 10:15:52 +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:
Kosta Korenkov 2014-07-26 01:05:22 +04:00
parent b2efb0ddc2
commit 55803b15ac

View File

@ -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