55 | @@ -57,29 +56,35 @@ def run_test(self):
56 | self.nodes[0].p2p.wait_for_tx(txid)
57 | assert_equal(self.nodes[0].getmempoolinfo()['size'], 1)
58 |
59 | - self.log.info('Check that txs from forcerelay peers are not rejected and relayed to others')
60 | - self.log.info("Restarting node 0 with forcerelay permission and blocksonly")
61 | - self.restart_node(0, ["-persistmempool=0", "-whitelist=127.0.0.1", "-whitelistforcerelay", "-blocksonly"])
62 | + self.log.info('Check that txs from RELAY-whitelisted peers are not rejected and relayed to others')
63 | + self.log.info("Restarting node 0 with relay permission and blocksonly")
64 | + self.restart_node(0, ["-persistmempool=0", "-whitelist=127.0.0.1", "-whitelistrelay", "-blocksonly"])
Can't this be written shorter as:
self.restart_node(0, ["-persistmempool=0", "-whitelist=relay@127.0.0.1", "-blocksonly"])
I thought so too, but interestingly it doesn't work.
When setting whitelist=relay@127.0.0.1 and doing a getpeerinfo, the permissions are correctly set to relay, but whitelisted is set to false...
whitelisted is there for backward compatibility only:
// If this flag is present, the user probably expect that RPC and QT report it as whitelisted (backward compatibility).
Your test should still work even after marco's suggestion? You just have to update the following stuff too: drop the legacy assert_equal(peer_1_info['whitelisted'], True) stuff
(I'm fine keeping it as is too)
Great, thanks for the explanation, the rest of the test indeed works fine once changed.
I'll remove that check if that is a deprecated flag, it can be misleading for newcomers.