mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 23:09:44 -04:00
[test] feefilter during and after IBD
Co-authored-by: Jon Atack <jon@atack.com>
This commit is contained in:
parent
2af56d6d5c
commit
cb31ee01b4
2 changed files with 45 additions and 0 deletions
44
test/functional/p2p_ibd_txrelay.py
Executable file
44
test/functional/p2p_ibd_txrelay.py
Executable file
|
@ -0,0 +1,44 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
# Copyright (c) 2020 The Bitcoin Core developers
|
||||||
|
# Distributed under the MIT software license, see the accompanying
|
||||||
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
"""Test fee filters during and after IBD."""
|
||||||
|
|
||||||
|
from decimal import Decimal
|
||||||
|
|
||||||
|
from test_framework.messages import COIN
|
||||||
|
from test_framework.test_framework import BitcoinTestFramework
|
||||||
|
from test_framework.util import assert_equal
|
||||||
|
|
||||||
|
MAX_FEE_FILTER = Decimal(9170997) / COIN
|
||||||
|
NORMAL_FEE_FILTER = Decimal(100) / COIN
|
||||||
|
|
||||||
|
|
||||||
|
class P2PIBDTxRelayTest(BitcoinTestFramework):
|
||||||
|
def set_test_params(self):
|
||||||
|
self.setup_clean_chain = True
|
||||||
|
self.num_nodes = 2
|
||||||
|
self.extra_args = [
|
||||||
|
["-minrelaytxfee={}".format(NORMAL_FEE_FILTER)],
|
||||||
|
["-minrelaytxfee={}".format(NORMAL_FEE_FILTER)],
|
||||||
|
]
|
||||||
|
def run_test(self):
|
||||||
|
self.log.info("Check that nodes set minfilter to MAX_MONEY while still in IBD")
|
||||||
|
for node in self.nodes:
|
||||||
|
assert node.getblockchaininfo()['initialblockdownload']
|
||||||
|
for conn_info in node.getpeerinfo():
|
||||||
|
assert_equal(conn_info['minfeefilter'], MAX_FEE_FILTER)
|
||||||
|
|
||||||
|
# Come out of IBD by generating a block
|
||||||
|
self.nodes[0].generate(1)
|
||||||
|
self.sync_all()
|
||||||
|
|
||||||
|
self.log.info("Check that nodes reset minfilter after coming out of IBD")
|
||||||
|
for node in self.nodes:
|
||||||
|
assert not node.getblockchaininfo()['initialblockdownload']
|
||||||
|
for conn_info in node.getpeerinfo():
|
||||||
|
assert_equal(conn_info['minfeefilter'], NORMAL_FEE_FILTER)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
P2PIBDTxRelayTest().main()
|
|
@ -246,6 +246,7 @@ BASE_SCRIPTS = [
|
||||||
'rpc_help.py',
|
'rpc_help.py',
|
||||||
'feature_help.py',
|
'feature_help.py',
|
||||||
'feature_shutdown.py',
|
'feature_shutdown.py',
|
||||||
|
'p2p_ibd_txrelay.py',
|
||||||
# Don't append tests at the end to avoid merge conflicts
|
# Don't append tests at the end to avoid merge conflicts
|
||||||
# Put them in a random line within the section that fits their approximate run-time
|
# Put them in a random line within the section that fits their approximate run-time
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Reference in a new issue