mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-12 19:20:42 +02:00
Merge whitelist_outgoing_auto
This commit is contained in:
commit
ec174daacb
@ -590,7 +590,7 @@ void SetupServerArgs(ArgsManager& argsman)
|
||||
argsman.AddArg("-whitelist=<[permissions@]IP address or network>", "Add permission flags to the peers using the given IP address (e.g. 1.2.3.4) or "
|
||||
"CIDR-notated network (e.g. 1.2.3.0/24). Uses the same permissions as "
|
||||
"-whitebind. "
|
||||
"Additional flags \"in\" and \"out\" control whether permissions apply to incoming connections and/or manual (default: incoming only). "
|
||||
"Additional flags \"in\" and \"out\" control whether permissions apply to incoming connections and/or outgoing (default: incoming only). "
|
||||
"Can be specified multiple times.", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
|
||||
g_wallet_init_interface.AddWalletOptions(argsman);
|
||||
|
@ -511,8 +511,7 @@ CNode* CConnman::ConnectNode(CAddress addrConnect, const char *pszDest, bool fCo
|
||||
}
|
||||
|
||||
NetPermissionFlags permission_flags = NetPermissionFlags::None;
|
||||
std::vector<NetWhitelistPermissions> whitelist_permissions = conn_type == ConnectionType::MANUAL ? vWhitelistedRangeOutgoing : std::vector<NetWhitelistPermissions>{};
|
||||
AddWhitelistPermissionFlags(permission_flags, target_addr, whitelist_permissions);
|
||||
AddWhitelistPermissionFlags(permission_flags, target_addr, vWhitelistedRangeOutgoing);
|
||||
|
||||
// Add node
|
||||
NodeId id = GetNewNodeId();
|
||||
|
@ -307,6 +307,13 @@ class InvalidMessagesTest(BitcoinTestFramework):
|
||||
peer.send_message(msg_headers([blockheader]))
|
||||
peer.wait_for_disconnect()
|
||||
|
||||
self.log.info('Test same previous scenario but with a whitelisted (noban) outbound peer. '
|
||||
'It should log as misbehaving but not cause a disconnection')
|
||||
self.restart_node(0, extra_args=["-whitelist=noban,out@127.0.0.1"])
|
||||
ob_peer = self.nodes[0].add_outbound_p2p_connection(P2PInterface(), p2p_idx=5)
|
||||
with self.nodes[0].assert_debug_log(['Misbehaving', 'header with invalid proof of work']):
|
||||
ob_peer.send_and_ping(msg_headers([blockheader]))
|
||||
|
||||
def test_noncontinuous_headers_msg(self):
|
||||
self.log.info("Test headers message with non-continuous headers sequence is logged as misbehaving")
|
||||
block_hashes = self.generate(self.nodes[0], 10)
|
||||
|
Loading…
Reference in New Issue
Block a user