[lbry] txscript: recognize LBRY claim script OPCODES
This commit is contained in:
parent
2b28dfa528
commit
61a18152e9
1 changed files with 17 additions and 13 deletions
|
@ -220,9 +220,9 @@ const (
|
||||||
OP_CHECKSEQUENCEVERIFY = 0xb2 // 178 - AKA OP_NOP3
|
OP_CHECKSEQUENCEVERIFY = 0xb2 // 178 - AKA OP_NOP3
|
||||||
OP_NOP4 = 0xb3 // 179
|
OP_NOP4 = 0xb3 // 179
|
||||||
OP_NOP5 = 0xb4 // 180
|
OP_NOP5 = 0xb4 // 180
|
||||||
OP_NOP6 = 0xb5 // 181
|
OP_CLAIMNAME = 0xb5 // 181 - AKA OP_NOP6
|
||||||
OP_NOP7 = 0xb6 // 182
|
OP_SUPPORTCLAIM = 0xb6 // 182 - AKA OP_NOP7
|
||||||
OP_NOP8 = 0xb7 // 183
|
OP_UPDATECLAIM = 0xb7 // 183 - AKA OP_NOP8
|
||||||
OP_NOP9 = 0xb8 // 184
|
OP_NOP9 = 0xb8 // 184
|
||||||
OP_NOP10 = 0xb9 // 185
|
OP_NOP10 = 0xb9 // 185
|
||||||
OP_UNKNOWN186 = 0xba // 186
|
OP_UNKNOWN186 = 0xba // 186
|
||||||
|
@ -504,9 +504,9 @@ var opcodeArray = [256]opcode{
|
||||||
OP_NOP1: {OP_NOP1, "OP_NOP1", 1, opcodeNop},
|
OP_NOP1: {OP_NOP1, "OP_NOP1", 1, opcodeNop},
|
||||||
OP_NOP4: {OP_NOP4, "OP_NOP4", 1, opcodeNop},
|
OP_NOP4: {OP_NOP4, "OP_NOP4", 1, opcodeNop},
|
||||||
OP_NOP5: {OP_NOP5, "OP_NOP5", 1, opcodeNop},
|
OP_NOP5: {OP_NOP5, "OP_NOP5", 1, opcodeNop},
|
||||||
OP_NOP6: {OP_NOP6, "OP_NOP6", 1, opcodeNop},
|
OP_CLAIMNAME: {OP_CLAIMNAME, "OP_CLAIMNAME", 1, opcodeClaimScript},
|
||||||
OP_NOP7: {OP_NOP7, "OP_NOP7", 1, opcodeNop},
|
OP_SUPPORTCLAIM: {OP_SUPPORTCLAIM, "OP_SUPPORTCLAIM", 1, opcodeClaimScript},
|
||||||
OP_NOP8: {OP_NOP8, "OP_NOP8", 1, opcodeNop},
|
OP_UPDATECLAIM: {OP_UPDATECLAIM, "OP_UPDATECLAIM", 1, opcodeClaimScript},
|
||||||
OP_NOP9: {OP_NOP9, "OP_NOP9", 1, opcodeNop},
|
OP_NOP9: {OP_NOP9, "OP_NOP9", 1, opcodeNop},
|
||||||
OP_NOP10: {OP_NOP10, "OP_NOP10", 1, opcodeNop},
|
OP_NOP10: {OP_NOP10, "OP_NOP10", 1, opcodeNop},
|
||||||
|
|
||||||
|
@ -725,8 +725,7 @@ func opcodeN(op *opcode, data []byte, vm *Engine) error {
|
||||||
func opcodeNop(op *opcode, data []byte, vm *Engine) error {
|
func opcodeNop(op *opcode, data []byte, vm *Engine) error {
|
||||||
switch op.value {
|
switch op.value {
|
||||||
case OP_NOP1, OP_NOP4, OP_NOP5,
|
case OP_NOP1, OP_NOP4, OP_NOP5,
|
||||||
OP_NOP6, OP_NOP7, OP_NOP8, OP_NOP9, OP_NOP10:
|
OP_NOP9, OP_NOP10:
|
||||||
|
|
||||||
if vm.hasFlag(ScriptDiscourageUpgradableNops) {
|
if vm.hasFlag(ScriptDiscourageUpgradableNops) {
|
||||||
str := fmt.Sprintf("%v reserved for soft-fork "+
|
str := fmt.Sprintf("%v reserved for soft-fork "+
|
||||||
"upgrades", op.name)
|
"upgrades", op.name)
|
||||||
|
@ -736,6 +735,11 @@ func opcodeNop(op *opcode, data []byte, vm *Engine) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func opcodeClaimScript(op *opcode, data []byte, vm *Engine) error {
|
||||||
|
vm.dstack.PushByteArray([]byte{0})
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// popIfBool enforces the "minimal if" policy during script execution if the
|
// popIfBool enforces the "minimal if" policy during script execution if the
|
||||||
// particular flag is set. If so, in order to eliminate an additional source
|
// particular flag is set. If so, in order to eliminate an additional source
|
||||||
// of nuisance malleability, post-segwit for version 0 witness programs, we now
|
// of nuisance malleability, post-segwit for version 0 witness programs, we now
|
||||||
|
|
Loading…
Reference in a new issue