mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-10 13:20:38 +02:00
message-capture-parser: fix out of bounds error for empty vectors
This commit is contained in:
parent
a55606c3bd
commit
42bbbba7c8
@ -79,7 +79,8 @@ def to_jsonable(obj: Any) -> Any:
|
||||
val = getattr(obj, slot, None)
|
||||
if slot in HASH_INTS and isinstance(val, int):
|
||||
ret[slot] = ser_uint256(val).hex()
|
||||
elif slot in HASH_INT_VECTORS and isinstance(val[0], int):
|
||||
elif slot in HASH_INT_VECTORS:
|
||||
assert all(isinstance(a, int) for a in val)
|
||||
ret[slot] = [ser_uint256(a).hex() for a in val]
|
||||
else:
|
||||
ret[slot] = to_jsonable(val)
|
||||
|
Loading…
x
Reference in New Issue
Block a user