Skip to content

Commit 69d81db

Browse files
committed
Bugfix for uint256_to_str
1 parent 8095402 commit 69d81db

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

bitcoin/core/serialize.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,14 +344,13 @@ def compact_from_uint256(v):
344344
def uint256_to_str(u):
345345
r = b""
346346
for i in range(8):
347-
r += struct.pack('<I', u >> (i * 32) & 0xffff)
347+
r += struct.pack('<I', u >> (i * 32) & 0xffffffff)
348348
return r
349349

350350
def uint256_to_shortstr(u):
351351
s = "%064x" % (u,)
352352
return s[:16]
353353

354-
355354
__all__ = (
356355
'MAX_SIZE',
357356
'Hash',

0 commit comments

Comments
 (0)