Skip to content

Commit beead33

Browse files
glozowmzumsande
authored andcommitted
[test] no send feefilters when txrelay is turned off
1 parent 18a9b27 commit beead33

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/functional/p2p_feefilter.py

+14
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def set_test_params(self):
6161
def run_test(self):
6262
self.test_feefilter_forcerelay()
6363
self.test_feefilter()
64+
self.test_feefilter_blocksonly()
6465

6566
def test_feefilter_forcerelay(self):
6667
self.log.info('Check that peers without forcerelay permission (default) get a feefilter message')
@@ -119,6 +120,19 @@ def test_feefilter(self):
119120
conn.wait_for_invs_to_match(txids)
120121
conn.clear_invs()
121122

123+
def test_feefilter_blocksonly(self):
124+
"""Test that we don't send fee filters to block-relay-only peers and when we're in blocksonly mode."""
125+
self.log.info("Check that we don't send fee filters to block-relay-only peers.")
126+
feefilter_peer = self.nodes[0].add_outbound_p2p_connection(FeefilterConn(), p2p_idx=0, connection_type="block-relay-only")
127+
feefilter_peer.sync_with_ping()
128+
feefilter_peer.assert_feefilter_received(False)
129+
130+
self.log.info("Check that we don't send fee filters when in blocksonly mode.")
131+
self.restart_node(0, ["-blocksonly"])
132+
feefilter_peer = self.nodes[0].add_p2p_connection(FeefilterConn())
133+
feefilter_peer.sync_with_ping()
134+
feefilter_peer.assert_feefilter_received(False)
135+
122136

123137
if __name__ == '__main__':
124138
FeeFilterTest().main()

0 commit comments

Comments
 (0)