mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge 1d5325a8f9 into merged_master (Bitcoin PR bitcoin/bitcoin#25117)
This commit is contained in:
commit
ec0e4e0aaa
1 changed files with 1 additions and 5 deletions
|
|
@ -43,12 +43,8 @@ def mini_parser(dat_file):
|
|||
break
|
||||
tmp_header = BytesIO(tmp_header_raw)
|
||||
tmp_header.read(TIME_SIZE) # skip the timestamp field
|
||||
raw_msgtype = tmp_header.read(MSGTYPE_SIZE)
|
||||
msgtype: bytes = raw_msgtype.split(b'\x00', 1)[0]
|
||||
remainder = raw_msgtype.split(b'\x00', 1)[1]
|
||||
assert(len(msgtype) > 0)
|
||||
msgtype = tmp_header.read(MSGTYPE_SIZE).rstrip(b'\x00')
|
||||
assert(msgtype in MESSAGEMAP)
|
||||
assert(len(remainder) == 0 or not remainder.decode().isprintable())
|
||||
length: int = int.from_bytes(tmp_header.read(LENGTH_SIZE), "little")
|
||||
data = f_in.read(length)
|
||||
assert_equal(len(data), length)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue