This introduces a Mnemonic class for BIP39 (seed words)
validation as well as a HDMasterKey class with provides the
BIP32 & BIP43 support.
All tests went into the apputils unit test.
This test tests the new Mining::SubmitBlock feature.
We also test the GetBlock with the new FilterOnScriptType feature.
Some new helper methods in the messageBuilder and FastBlock are also
used and tested.
The test starts to become long to run and using the one main.cpp
hack we had removes our ability to select one test to run, so lets
go back to one executable per class.
People all over the Internet, including on the BCH spec, seem confused
about these enum values. They think they are opcodes.
So lets be clear and rename them to the thing they are. Placeholders or
a return-code.
as the expected behavior of 'get*' is a const method, it is harmful to
name a method such when it actually alters the state of the method such
that subsequent calls will produce a different result.
The CAmount name is not helpful as its just an int64_t and not a
class, like the name implies. There were a handful of places where
it was passed in as const-ref, as a good example of this actually
creating sub-par code.
Move the MutableTransactionSignatureChecker class out of the header and
thereby remove the need to include transaction.h in the header.
This checker was never used in any app, just in the unit tests.
This also fixes includes around.
Especially seen in the block-validation tests, we sometimes delete
the validation engine while some other threads are still doing stuff
with the not surprising effect that we may cause crashes or asserts
to get hit.
This change makes us wait instead.
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