Commit 7d7d989c authored by Ivan Jose Lozano Fernandez's avatar Ivan Jose Lozano Fernandez Committed by Daniel Connolly

fixed a bug in the "isPushOnly" method, whish failes when the script has no ScriptChunks in it.

parent 29130168
......@@ -1899,6 +1899,7 @@ public class Script {
txContainingThis.hashForSignature(index, connectedScript, (byte) sig.sighashFlags);
sigValid = ECKey.verify(hash.getBytes(), sig, pubKey);
}
} catch (SignatureFormatError e) {
......@@ -2264,14 +2265,15 @@ public class Script {
boolean result = true;
Iterator<ScriptChunk> it = chunks.iterator();
do {
while (result && it.hasNext()) {
int opCode = it.next().opcode;
// Note that IsPushOnly() *does* consider OP_RESERVED to be a push-type
// opcode, however execution of OP_RESERVED fails, so it's not relevant
// to P2SH/BIP62 as the scriptSig would fail prior to the P2SH special
// validation code being executed.
if (opCode > ScriptOpCodes.OP_16) result = false;
} while (result && it.hasNext());
} // while...
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment