From 1a8cd10e8298ce9f7d269b5ab2957ada6153794e Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Wed, 18 Nov 2020 16:11:21 +0000 Subject: [PATCH] net_permissions: Include "addr" permission on implicit whitelist entries --- src/net.cpp | 1 + test/functional/p2p_permissions.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 32662f286a..719f2c0cef 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -573,6 +573,7 @@ void CConnman::AddWhitelistPermissionFlags(NetPermissionFlags& flags, const CNet } NetPermissions::AddFlag(flags, NetPermissionFlags::Mempool); NetPermissions::AddFlag(flags, NetPermissionFlags::NoBan); + NetPermissions::AddFlag(flags, NetPermissionFlags::Addr); } } diff --git a/test/functional/p2p_permissions.py b/test/functional/p2p_permissions.py index bbf0328757..cd063dbd12 100755 --- a/test/functional/p2p_permissions.py +++ b/test/functional/p2p_permissions.py @@ -33,7 +33,7 @@ class P2PPermissionsTests(BitcoinTestFramework): # default permissions (no specific permissions) ["-whitelist=127.0.0.1"], # Make sure the default values in the command line documentation match the ones here - ["relay", "noban", "mempool", "download"]) + ["addr", "relay", "noban", "mempool", "download"]) self.checkpermission( # no permission (even with forcerelay) @@ -43,14 +43,14 @@ class P2PPermissionsTests(BitcoinTestFramework): self.checkpermission( # relay permission removed (no specific permissions) ["-whitelist=127.0.0.1", "-whitelistrelay=0"], - ["noban", "mempool", "download"]) + ["addr", "noban", "mempool", "download"]) self.checkpermission( # forcerelay and relay permission added # Legacy parameter interaction which set whitelistrelay to true # if whitelistforcerelay is true ["-whitelist=127.0.0.1", "-whitelistforcerelay"], - ["forcerelay", "relay", "noban", "mempool", "download"]) + ["addr", "forcerelay", "relay", "noban", "mempool", "download"]) # Let's make sure permissions are merged correctly # For this, we need to use whitebind instead of bind