mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
[test] no send feefilters when txrelay is turned off
This commit is contained in:
parent
18a9b27dd6
commit
beead33a21
1 changed files with 14 additions and 0 deletions
|
@ -61,6 +61,7 @@ class FeeFilterTest(BitcoinTestFramework):
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
self.test_feefilter_forcerelay()
|
self.test_feefilter_forcerelay()
|
||||||
self.test_feefilter()
|
self.test_feefilter()
|
||||||
|
self.test_feefilter_blocksonly()
|
||||||
|
|
||||||
def test_feefilter_forcerelay(self):
|
def test_feefilter_forcerelay(self):
|
||||||
self.log.info('Check that peers without forcerelay permission (default) get a feefilter message')
|
self.log.info('Check that peers without forcerelay permission (default) get a feefilter message')
|
||||||
|
@ -119,6 +120,19 @@ class FeeFilterTest(BitcoinTestFramework):
|
||||||
conn.wait_for_invs_to_match(txids)
|
conn.wait_for_invs_to_match(txids)
|
||||||
conn.clear_invs()
|
conn.clear_invs()
|
||||||
|
|
||||||
|
def test_feefilter_blocksonly(self):
|
||||||
|
"""Test that we don't send fee filters to block-relay-only peers and when we're in blocksonly mode."""
|
||||||
|
self.log.info("Check that we don't send fee filters to block-relay-only peers.")
|
||||||
|
feefilter_peer = self.nodes[0].add_outbound_p2p_connection(FeefilterConn(), p2p_idx=0, connection_type="block-relay-only")
|
||||||
|
feefilter_peer.sync_with_ping()
|
||||||
|
feefilter_peer.assert_feefilter_received(False)
|
||||||
|
|
||||||
|
self.log.info("Check that we don't send fee filters when in blocksonly mode.")
|
||||||
|
self.restart_node(0, ["-blocksonly"])
|
||||||
|
feefilter_peer = self.nodes[0].add_p2p_connection(FeefilterConn())
|
||||||
|
feefilter_peer.sync_with_ping()
|
||||||
|
feefilter_peer.assert_feefilter_received(False)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
FeeFilterTest().main()
|
FeeFilterTest().main()
|
||||||
|
|
Loading…
Add table
Reference in a new issue