mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-02-25 07:17:32 +01:00
Fixing duplication of OP_CHECKSIGVERIFY, fixing comment
This commit is contained in:
parent
34a897b6ac
commit
154a041cdb
1 changed files with 1 additions and 27 deletions
|
@ -120,34 +120,8 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Runs OP_CHECKMULTISIG with an OP_VERIFY afterwards
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
def opCheckSigVerify(program : ScriptProgram) : ScriptProgram = {
|
||||
require(program.script.headOption.isDefined && program.script.head == OP_CHECKSIGVERIFY,
|
||||
"Script top must be OP_CHECKSIGVERIFY")
|
||||
if (program.stack.size < 2) {
|
||||
logger.error("Stack must contain at least 3 items for OP_CHECKSIGVERIFY")
|
||||
ScriptProgram(program,ScriptErrorInvalidStackOperation)
|
||||
} else {
|
||||
val newScript = OP_CHECKSIG :: OP_VERIFY :: program.script.tail
|
||||
val newProgram = ScriptProgram(program,newScript, ScriptProgram.Script)
|
||||
val programFromOpCheckSig = opCheckSig(newProgram)
|
||||
logger.debug("Stack after OP_CHECKSIG execution: " + programFromOpCheckSig.stack)
|
||||
programFromOpCheckSig match {
|
||||
case _ : PreExecutionScriptProgram | _ : ExecutedScriptProgram =>
|
||||
programFromOpCheckSig
|
||||
case _ : ExecutionInProgressScriptProgram => opVerify(programFromOpCheckSig)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs OP_CHECKMULTISIG with an OP_VERIFY afterwards
|
||||
* Runs OP_CHECKSIG with an OP_VERIFY afterwards
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue