diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-06-14 01:47:53 +0200 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-06-14 14:28:50 +0200 |
commit | 42bbbba7c83d1e2baad18b4c6f05bad1358eb117 (patch) | |
tree | 72485d08e16737abe8ab418852091c74b9952239 | |
parent | a55606c3bdbfdf660b093bc2a618d537ffae7f26 (diff) | |
download | bitcoin-42bbbba7c83d1e2baad18b4c6f05bad1358eb117.tar.xz |
message-capture-parser: fix out of bounds error for empty vectors
-rwxr-xr-x | contrib/message-capture/message-capture-parser.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/message-capture/message-capture-parser.py b/contrib/message-capture/message-capture-parser.py index 9988478f1b..eefd22a60e 100755 --- a/contrib/message-capture/message-capture-parser.py +++ b/contrib/message-capture/message-capture-parser.py @@ -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) |