Summary:
CMerkleBlock::CMerkleBlock called IsRelevantAndUpdate() on each transaction
in order, which (due to the outpoint-adding feature) assumes a topological
order of transactions in order to work correctly. If an outpoint of
interest were created later in a block than when gets spent, then it would
be added into the bloom filter too late, and thus that spending transaction
would get missed.
This changes CMerkleBlock::CMerkleBlock to scan all outputs first, then
make a second loop to scan all inputs. This requires breaking up the
IsRelevantAndUpdate() function into two parts. The original
IsRelevantAndUpdate() functionality remains fully intact however, as it
gets called from mempool-related code (mempool has topological order) and
tests.
Note that vMatchedTxn.push_back is moved into the second loop so that index
i keeps ascending order, in case that is somehow relevant. (the tests at
least do check this)
A two-loop construction like this will very slightly increase the false
positive rate.
Originally by: Mark Lundeberg
The API throws when the directories already exist, which is quite
unexpected.
This now changes the code to silently ignore these issues in the
knowledge that the immediately following opening of files will
fail with a nice error message.
I got some UTXOs to test and now got some blocks filled
there, which proves the concept.
Its a bit slow to start (1 -> 20 tx are hardcoded) which was not an
issue if you can call generate() to mine, may be useful to adjust
for scalenet.
Yet, the basis works.
Don't even try to search for some GUI packages when the setup says we
should not compile the GUI components.
This should make the configure output easier to interpret.
Don't even try to search for some GUI packages when the setup says we
should not compile the GUI components.
This should make the configure output easier to interpret.
This adds a unit test to see if the combination of invalidateBlock and
reconsiderBlock do what we expect to do.
The main issue was that we store an invalidated block in the UTXO and we
forgot to re-validate that on reconsider.
Additionally I avoid writing a lot of unchanged data to the block-index.
When there is no config we now bind on all available (at startup)
interfaces to listen for service requests.
This solves the problem where a fresh server would not listen to
requests from the outside world but only on localhost.