mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-11 21:20:39 +02:00
init: make inbound tx relay percentage configurable
Permit users to change the amount of inbounds that are permitted to relay transactions. This is particularly relevant to ensure that superusers that are not concerned with resource usage are not artificially restricted from offering many transaction relay slots to the network. Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
This commit is contained in:
committed by
Martin Zumsande
parent
cc59aee196
commit
0bd3d3dfa5
@@ -58,6 +58,16 @@ class P2PConnectionLimits(BitcoinTestFramework):
|
||||
self.nodes[0].add_p2p_connection(P2PInterface(), send_version=False, wait_for_verack=False, expect_success=False)
|
||||
self.wait_until(lambda: len(node.getpeerinfo()) == 2)
|
||||
|
||||
self.log.info('Test different values of inboundrelaypercent')
|
||||
self.restart_node(0, ['-maxconnections=13', '-inboundrelaypercent=0'])
|
||||
with node.assert_debug_log(['failed to find a tx-relaying eviction candidate - connection dropped'], timeout=2):
|
||||
self.nodes[0].add_p2p_connection(P2PInterface(), expect_success=False, wait_for_verack=False)
|
||||
|
||||
self.restart_node(0, ['-maxconnections=13', '-inboundrelaypercent=100'])
|
||||
node.add_p2p_connection(P2PInterface())
|
||||
node.add_p2p_connection(P2PInterface())
|
||||
self.wait_until(lambda: len(node.getpeerinfo()) == 2)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
P2PConnectionLimits(__file__).main()
|
||||
|
||||
@@ -76,7 +76,7 @@ class PackageRelayTest(BitcoinTestFramework):
|
||||
self.setup_clean_chain = True
|
||||
self.num_nodes = 1
|
||||
self.extra_args = [[
|
||||
"-maxmempool=5","-maxconnections=150"
|
||||
"-maxmempool=5","-inboundrelaypercent=100"
|
||||
]]
|
||||
|
||||
def create_tx_below_mempoolminfee(self, wallet, utxo_to_spend=None):
|
||||
|
||||
Reference in New Issue
Block a user