This test was passing because we never fetch blocks if we only receive
an inv and not the header (after 037159cebf),
and this test wasn't delivering the header.
Policy limits (such as chain limits and mempool total size) could reasonably
be enforced more aggressively during a reorg, so use resendwallettransactions
to repopulate the mempool to avoid mined blocks being too small, and increase
the chain limits from the default for this test.
This is in preparation for a change in mempool behavior during a reorg.
The functional tests and util tests both require a config file that is
generated by ./configure. This commit merges those two config
files into a single configuration file that can be shared by both tests.
The config from config.ini is put into a Namespace object to maintain
the interface with bctest.py. A future commit could change this
interface to use a dictionary instead of a namespace.
* Split run_test into 4 separate tests
* Add 2 tests, getconnectioncount and getnettotals
* getnettotals - Strategy of test is to get the network stats before and after a ping. The difference in bytes sent/received is the bytes needed for a ping/pong.
This commit uses the new skip test funcationality added in
232b6665bc to skip the zmq tests if the
python zmq module is not available or if bitcoind has been built without
zmq support.
This removes the zmq-specific logic from test_runner.py. In general it's
better if test_runner.py has no knowledge of special cases for
individual tests and is a general purpose test runner.
All Node classes in individual test cases subclass from NodeConnCB. Many
have duplicate definitions for methods that are defined in the base
class. This commit removes those duplicate definitions.
This commit removes ~290 lines of duplicate code.
This commit adds some helper functions to NodeConnCB which are useful
for many tests:
- NodeConnCB now keeps track of the number of each message type that
it's received and the most recent message of each type. Many tests
assert on the most recent block, tx or reject message.
- NodeConnCB now keeps track of its connection state by setting a
connected boolean in on_open() and on_close()
- NodeConnCB now has wait_for_block, wait_for_getdata,
wait_for_getheaders, wait_for_inv and wait_for_verack methods
I have updated the individual test cases to make sure that there are no
namespace problems that cause them to fail with these new definitions.
Future commits will remove the duplicate code.
maxblocksinflight tested that a node would not send get_data messages
for more than 16 new blocks at the same time. bitcoin core no longer
responds to block invs with get_data, since it does headers-first
sync'ing. This test was therefore testing nothing and can be removed.
the sendheaders test script tests that bitcoin will not send get_headers
for more than 16 blocks simultaneously.