mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-01-19 05:33:44 +01:00
Script: expose execute publicly
This commit is contained in:
parent
a8f85d1158
commit
ba4aeff2a5
@ -723,7 +723,14 @@ public class Script {
|
||||
return Utils.decodeMPI(Utils.reverseBytes(chunk), false);
|
||||
}
|
||||
|
||||
private static void executeScript(Transaction txContainingThis, long index,
|
||||
/**
|
||||
* Exposes the script interpreter. Normally you should not use this directly, instead use
|
||||
* {@link org.bitcoinj.core.TransactionInput#verify(org.bitcoinj.core.TransactionOutput)} or
|
||||
* {@link org.bitcoinj.script.Script#correctlySpends(org.bitcoinj.core.Transaction, long, Script)}. This method
|
||||
* is useful if you need more precise control or access to the final state of the stack. This interface is very
|
||||
* likely to change in future.
|
||||
*/
|
||||
public static void executeScript(@Nullable Transaction txContainingThis, long index,
|
||||
Script script, LinkedList<byte[]> stack, boolean enforceNullDummy) throws ScriptException {
|
||||
int opCount = 0;
|
||||
int lastCodeSepLocation = 0;
|
||||
@ -1198,10 +1205,14 @@ public class Script {
|
||||
break;
|
||||
case OP_CHECKSIG:
|
||||
case OP_CHECKSIGVERIFY:
|
||||
if (txContainingThis == null)
|
||||
throw new IllegalStateException("Script attempted signature check but no tx was provided");
|
||||
executeCheckSig(txContainingThis, (int) index, script, stack, lastCodeSepLocation, opcode);
|
||||
break;
|
||||
case OP_CHECKMULTISIG:
|
||||
case OP_CHECKMULTISIGVERIFY:
|
||||
if (txContainingThis == null)
|
||||
throw new IllegalStateException("Script attempted signature check but no tx was provided");
|
||||
opCount = executeMultiSig(txContainingThis, (int) index, script, stack, opCount, lastCodeSepLocation, opcode, enforceNullDummy);
|
||||
break;
|
||||
case OP_NOP1:
|
||||
|
Loading…
Reference in New Issue
Block a user