Merge netperms_implicit_addr

This commit is contained in:
Luke Dashjr 2025-03-05 03:27:08 +00:00
commit 9ffb23bb84
2 changed files with 4 additions and 3 deletions

View File

@ -581,6 +581,7 @@ void CConnman::AddWhitelistPermissionFlags(NetPermissionFlags& flags, const CNet
if (whitelist_relay) NetPermissions::AddFlag(flags, NetPermissionFlags::Relay);
NetPermissions::AddFlag(flags, NetPermissionFlags::Mempool);
NetPermissions::AddFlag(flags, NetPermissionFlags::NoBan);
NetPermissions::AddFlag(flags, NetPermissionFlags::Addr);
}
}

View File

@ -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