Open garethjns opened 5 years ago
Two things that may help:
See Peter Wuille's answer here: https://bitcoin.stackexchange.com/questions/51620/cvarint-serialization-format Saying : "Still wrong. He's asking about the CVarInt used in UTXOs internally in Bitcoin Core. Not the variable-length push in scripts, or the CCompactLen used in the P2P protocol."
See Peter Wuille's answer here.
https://bitcoin.stackexchange.com/questions/86159/differences-to-ccompactsize-and-cvarint
"Blocks have well defined data only. But the files can contain garbage in addition to the blocks. There is an index database that stores which position each block is stored at."
I think the right solution would be to parse LevelDB files inside directory index/ to get exact location of blocks in .dat files.
You can get offset in file using thiese db : https://bitcoin.stackexchange.com/questions/28168/what-are-the-keys-used-in-the-blockchain-leveldb-ie-what-are-the-keyvalue-pair
(be careful at the end of the thread though, it is misleading)
Hi @papipig, thank you very much for the info and links!
The core wallet serialises larger (?) integers into the CVarInt format which is not read correctly by pybit.py3.common.Common. Any time a CVarInt is parsed, it returns as a massive number that breaks everything downstream of it.
https://bitcoin.stackexchange.com/questions/51620/cvarint-serialization-format