mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-02-25 07:17:32 +01:00
Removing OP_NOP3 since it has been repurposed for OP_CHECKSEQUENCEVERIFY
This commit is contained in:
parent
940ec1f4ad
commit
59ed11dc8a
2 changed files with 5 additions and 20 deletions
|
@ -19,7 +19,6 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The input is hashed twice: first with SHA-256 and then with RIPEMD-160.
|
* The input is hashed twice: first with SHA-256 and then with RIPEMD-160.
|
||||||
*
|
|
||||||
* @param program
|
* @param program
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -31,8 +30,7 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The input is hashed using RIPEMD-160.
|
* The input is hashed using RIPEMD-160.
|
||||||
*
|
* @param program
|
||||||
* @param program
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
def opRipeMd160(program : ScriptProgram) : ScriptProgram = {
|
def opRipeMd160(program : ScriptProgram) : ScriptProgram = {
|
||||||
|
@ -42,8 +40,7 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The input is hashed using SHA-256.
|
* The input is hashed using SHA-256.
|
||||||
*
|
* @param program
|
||||||
* @param program
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
def opSha256(program : ScriptProgram) : ScriptProgram = {
|
def opSha256(program : ScriptProgram) : ScriptProgram = {
|
||||||
|
@ -53,8 +50,7 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The input is hashed two times with SHA-256.
|
* The input is hashed two times with SHA-256.
|
||||||
*
|
* @param program
|
||||||
* @param program
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
def opHash256(program : ScriptProgram) : ScriptProgram = {
|
def opHash256(program : ScriptProgram) : ScriptProgram = {
|
||||||
|
@ -64,8 +60,7 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The input is hashed using SHA-1.
|
* The input is hashed using SHA-1.
|
||||||
*
|
* @param program
|
||||||
* @param program
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
def opSha1(program : ScriptProgram) : ScriptProgram = {
|
def opSha1(program : ScriptProgram) : ScriptProgram = {
|
||||||
|
@ -79,7 +74,6 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
||||||
* The signature used by OP_CHECKSIG must be a valid signature for this hash and public key.
|
* The signature used by OP_CHECKSIG must be a valid signature for this hash and public key.
|
||||||
* If it is, 1 is returned, 0 otherwise.
|
* If it is, 1 is returned, 0 otherwise.
|
||||||
* https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L818
|
* https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L818
|
||||||
*
|
|
||||||
* @param program
|
* @param program
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -139,7 +133,6 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs OP_CHECKSIG with an OP_VERIFY afterwards
|
* Runs OP_CHECKSIG with an OP_VERIFY afterwards
|
||||||
*
|
|
||||||
* @param program
|
* @param program
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -165,7 +158,6 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
||||||
/**
|
/**
|
||||||
* All of the signature checking words will only match signatures to the data
|
* All of the signature checking words will only match signatures to the data
|
||||||
* after the most recently-executed OP_CODESEPARATOR.
|
* after the most recently-executed OP_CODESEPARATOR.
|
||||||
*
|
|
||||||
* @param program
|
* @param program
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -194,7 +186,6 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
||||||
* signatures must be placed in the scriptSig using the same order as their corresponding public keys
|
* signatures must be placed in the scriptSig using the same order as their corresponding public keys
|
||||||
* were placed in the scriptPubKey or redeemScript. If all signatures are valid, 1 is returned, 0 otherwise.
|
* were placed in the scriptPubKey or redeemScript. If all signatures are valid, 1 is returned, 0 otherwise.
|
||||||
* Due to a bug, one extra unused value is removed from the stack.
|
* Due to a bug, one extra unused value is removed from the stack.
|
||||||
*
|
|
||||||
* @param program
|
* @param program
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -315,7 +306,6 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs OP_CHECKMULTISIG with an OP_VERIFY afterwards
|
* Runs OP_CHECKMULTISIG with an OP_VERIFY afterwards
|
||||||
*
|
|
||||||
* @param program
|
* @param program
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -342,7 +332,6 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
||||||
* This is a higher order function designed to execute a hash function on the stack top of the program
|
* This is a higher order function designed to execute a hash function on the stack top of the program
|
||||||
* For instance, we could pass in CryptoUtil.sha256 function as the 'hashFunction' argument, which would then
|
* For instance, we could pass in CryptoUtil.sha256 function as the 'hashFunction' argument, which would then
|
||||||
* apply sha256 to the stack top
|
* apply sha256 to the stack top
|
||||||
*
|
|
||||||
* @param program the script program whose stack top needs to be hashed
|
* @param program the script program whose stack top needs to be hashed
|
||||||
* @param hashFunction the hash function which needs to be used on the stack top (sha256,ripemd160,etc..)
|
* @param hashFunction the hash function which needs to be used on the stack top (sha256,ripemd160,etc..)
|
||||||
* @return
|
* @return
|
||||||
|
@ -362,7 +351,6 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
||||||
/**
|
/**
|
||||||
* Removes the OP_CODESEPARATOR in the original script according to
|
* Removes the OP_CODESEPARATOR in the original script according to
|
||||||
* the last code separator index in the script
|
* the last code separator index in the script
|
||||||
*
|
|
||||||
* @param program
|
* @param program
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -70,9 +70,6 @@ case object OP_NOP1 extends NOP {
|
||||||
override def opCode = 176
|
override def opCode = 176
|
||||||
}
|
}
|
||||||
|
|
||||||
case object OP_NOP3 extends NOP {
|
|
||||||
override def opCode = 178
|
|
||||||
}
|
|
||||||
case object OP_NOP4 extends NOP {
|
case object OP_NOP4 extends NOP {
|
||||||
override def opCode = 179
|
override def opCode = 179
|
||||||
}
|
}
|
||||||
|
@ -100,5 +97,5 @@ case class UndefinedOP_NOP(opCode : Int) extends ReservedOperation
|
||||||
object ReservedOperation extends ScriptOperationFactory[ReservedOperation] {
|
object ReservedOperation extends ScriptOperationFactory[ReservedOperation] {
|
||||||
lazy val undefinedOpCodes = for {i <- 0xba to 0xff} yield UndefinedOP_NOP(i)
|
lazy val undefinedOpCodes = for {i <- 0xba to 0xff} yield UndefinedOP_NOP(i)
|
||||||
def operations = Seq(OP_RESERVED,OP_VER,OP_VERIF,OP_VERNOTIF,OP_RESERVED, OP_RESERVED1, OP_RESERVED2,
|
def operations = Seq(OP_RESERVED,OP_VER,OP_VERIF,OP_VERNOTIF,OP_RESERVED, OP_RESERVED1, OP_RESERVED2,
|
||||||
OP_NOP, OP_NOP1,OP_NOP3,OP_NOP4,OP_NOP5,OP_NOP6,OP_NOP7,OP_NOP8, OP_NOP9, OP_NOP10) ++ undefinedOpCodes
|
OP_NOP, OP_NOP1,OP_NOP4,OP_NOP5,OP_NOP6,OP_NOP7,OP_NOP8, OP_NOP9, OP_NOP10) ++ undefinedOpCodes
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue