3
I'm developing a parser bitcoin core and I have a problem whit the type CVarInt, I using the decodifier mode of the CCompact size but at the block 976 I Have a problem whit the type, because the value id is unusually, so I have a question why the bitcoin core decided the change implementation to CCompact size into CVarInt?
What was introduced in the bitcoin core versions to require a change of implementation?
Sorry for my terrible English but I'm learning.
Oh this is a good news, Unfortunately I don't know exactly what block gives me problems reading the script, because for every blk file I create a json file with the list of blocks, so if I get an error reading I can't generate the json, apparte if not active the logger logs the code, which I will do soon, but for now I know that the last block that reads me converting it to json is the following This
– vincenzopalazzo – 2019-04-20T18:38:51.613plus i use the library to read bitcoin core files the file is serialize.he exception that raises me is the following
C ++ exception with description" ReadCompactSize (): size too large: iostream error "thrown in the test body.– vincenzopalazzo – 2019-04-20T18:41:19.280@vincenzopalazzo That probably means you're trying to decode garbage. There is no guarantee that all bytes in the block file belong to a block; there may be gaps etc – Pieter Wuille – 2019-04-20T19:16:50.360
So it is not guaranteed that all blocks have only the declared data? I mean, does this mean that in the beginning there may be other things that are not useful data for me? but in this way there must be a reference somewhere to see what is in that beginning file no? Because if bitcoin core uses that data then behind the serialization there is logic – vincenzopalazzo – 2019-04-20T19:21:31.763
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. There is no guarantee that there isn't garbage between blocks (for example, for a crash while writing a block). – Pieter Wuille – 2019-04-20T19:34:37.260
Is it possible that the block continues in the next file or is there some constraint that I don't know where each file must start with a block? – vincenzopalazzo – 2019-04-20T21:21:28.530
No, the whole block is always in the same file. – Pieter Wuille – 2019-04-20T21:36:05.783
Oh thanks, this is really a problem for me now – vincenzopalazzo – 2019-04-20T21:38:31.620