mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
fix paying to script
This commit is contained in:
parent
1f1ce26211
commit
b043c872eb
2 changed files with 8 additions and 10 deletions
|
@ -93,9 +93,11 @@ class PayToEdit(ScanQRTextEdit):
|
||||||
for word in x.split():
|
for word in x.split():
|
||||||
if word[0:3] == 'OP_':
|
if word[0:3] == 'OP_':
|
||||||
assert word in opcodes.lookup
|
assert word in opcodes.lookup
|
||||||
script += chr(opcodes.lookup[word])
|
opcode_int = opcodes.lookup[word]
|
||||||
|
assert opcode_int < 256 # opcode is single-byte
|
||||||
|
script += bitcoin.int_to_hex(opcode_int)
|
||||||
else:
|
else:
|
||||||
script += push_script(word).decode('hex')
|
script += push_script(word)
|
||||||
return script
|
return script
|
||||||
|
|
||||||
def parse_amount(self, x):
|
def parse_amount(self, x):
|
||||||
|
|
|
@ -229,10 +229,10 @@ opcodes = Enumeration("Opcodes", [
|
||||||
"OP_WITHIN", "OP_RIPEMD160", "OP_SHA1", "OP_SHA256", "OP_HASH160",
|
"OP_WITHIN", "OP_RIPEMD160", "OP_SHA1", "OP_SHA256", "OP_HASH160",
|
||||||
"OP_HASH256", "OP_CODESEPARATOR", "OP_CHECKSIG", "OP_CHECKSIGVERIFY", "OP_CHECKMULTISIG",
|
"OP_HASH256", "OP_CODESEPARATOR", "OP_CHECKSIG", "OP_CHECKSIGVERIFY", "OP_CHECKMULTISIG",
|
||||||
"OP_CHECKMULTISIGVERIFY",
|
"OP_CHECKMULTISIGVERIFY",
|
||||||
("OP_SINGLEBYTE_END", 0xF0),
|
("OP_NOP1", 0xB0),
|
||||||
("OP_DOUBLEBYTE_BEGIN", 0xF000),
|
("OP_CHECKLOCKTIMEVERIFY", 0xB1), ("OP_CHECKSEQUENCEVERIFY", 0xB2),
|
||||||
"OP_PUBKEY", "OP_PUBKEYHASH",
|
"OP_NOP4", "OP_NOP5", "OP_NOP6", "OP_NOP7", "OP_NOP8", "OP_NOP9", "OP_NOP10",
|
||||||
("OP_INVALIDOPCODE", 0xFFFF),
|
("OP_INVALIDOPCODE", 0xFF),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
@ -242,10 +242,6 @@ def script_GetOp(_bytes):
|
||||||
vch = None
|
vch = None
|
||||||
opcode = _bytes[i]
|
opcode = _bytes[i]
|
||||||
i += 1
|
i += 1
|
||||||
if opcode >= opcodes.OP_SINGLEBYTE_END:
|
|
||||||
opcode <<= 8
|
|
||||||
opcode |= _bytes[i]
|
|
||||||
i += 1
|
|
||||||
|
|
||||||
if opcode <= opcodes.OP_PUSHDATA4:
|
if opcode <= opcodes.OP_PUSHDATA4:
|
||||||
nSize = opcode
|
nSize = opcode
|
||||||
|
|
Loading…
Add table
Reference in a new issue