mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 17:31:36 +00:00
stricter tx deserialization: forbid negative output amount values
This commit is contained in:
parent
0b78cb5e6b
commit
12c5474cf1
1 changed files with 2 additions and 0 deletions
|
@ -536,6 +536,8 @@ def parse_output(vds, i):
|
|||
d['value'] = vds.read_int64()
|
||||
if d['value'] > TOTAL_COIN_SUPPLY_LIMIT_IN_BTC * COIN:
|
||||
raise SerializationError('invalid output amount (too large)')
|
||||
if d['value'] < 0:
|
||||
raise SerializationError('invalid output amount (negative)')
|
||||
scriptPubKey = vds.read_bytes(vds.read_compact_size())
|
||||
d['type'], d['address'] = get_address_from_output_script(scriptPubKey)
|
||||
d['scriptPubKey'] = bh2u(scriptPubKey)
|
||||
|
|
Loading…
Add table
Reference in a new issue