As the DiskSpaceChecker owns a deadlinetimer, which depends on the asio
io_service, we need to ensure it is destructed before the io_service is.
The io_service, and now the diskSpaceChecker as well, are specifically
shut down, in order.
Application is still a singleton that dies after main() ends, but will
have nearly no members at that time.
This makes it possible for the most recent file to not be the default
filesize but much smaller. This fixes us to writing outside of the
allocated membuffer and causing a kernel signal.
Additionally we start a new file for writes in that case.
This case is seen in the unit tests where we have a perfect-fitting file
in git which we then try to write to when adding a new block.
As such this is tested in the upcoming unit test.
This new flag to the getBlock API call allows us to select
a transaction based on the usage of a certain script opcode.
This uses the new metadata index.
For the txid/fee index we do a bit more than we can do for shallow block
validation.
Now we don't actually fully validate all transactions when this index is
enabled, we just fetch the fees.
The code that connects blocks together uses the block-hash (blockId) for
that, which we always just created on the fly.
Instead store the blockId on the state and in that way make adding
headers not entirely in-sequence be 10 times as fast.
Additionally, we wait with actual validation after a reindex until the
files are all found because otherwise we can't save the meta blocks.
This adds an option to the GetTransaction Flowee API to return the fees
for a whole transaction.
Support for this is added in the Blockchain (searcher) and the
RestService components.
Notice that no fees will be returned if the BlockMetaData was not
created properly.
this allows the user to ensure the metadata blocks fetch the previous
transaction in order to calculate the transaction-fee.
Normally this is skipped for transactions we don't need to do the script
validation for (old blocks).
[code-quality]
We got a warning about a dereference of a nullptr. But that implied we
have an impossible combination of member variables.
So, lets assert on that being impossible so;
a) we get a fail-fast if this ever happens.
b) the static code checker will stop warning us.
Notice that asserts are compiled out of release executables. So this is
effectively a no-op for releases.