You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from bitcoinlib.services.services import Service
srv = Service()
b = srv.getblock(300953)
print(b.serialize())
gives me the following error:
vpereira@foo:/mnt/c/Users/vpere/codes/bitcoin> python3 1.py
Traceback (most recent call last):
File "1.py", line 19, in <module>
print(b.serialize())
File "/usr/lib/python3.6/site-packages/bitcoinlib/blocks.py", line 298, in serialize
raise ValueError("Block contains incorrect number of transactions, can not serialize")
ValueError: Block contains incorrect number of transactions, can not serialize
The text was updated successfully, but these errors were encountered:
Yes, that's not the behavior you would expect. For efficiency reasons the getblock method by default only parses the first 10 transactions. So transactions are missing and the block cannot be serialized.
I'm not sure what your goal is, but you can also retrieve the serialized block with the getrawblock method. Or you could add a limit parameter to the getblock method and set it to 9999 for instance.
But I think this needs improvement and the getblock method should store the rawblock as well.
gives me the following error:
The text was updated successfully, but these errors were encountered: