Skip to content

Commit 9a79815

Browse files
committed
net_permissions: Include "addr" permission on implicit whitelist entries
1 parent 1248d0d commit 9a79815

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/net.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ void CConnman::AddWhitelistPermissionFlags(NetPermissionFlags& flags, const CNet
569569
if (whitelist_relay) NetPermissions::AddFlag(flags, NetPermissionFlags::Relay);
570570
NetPermissions::AddFlag(flags, NetPermissionFlags::Mempool);
571571
NetPermissions::AddFlag(flags, NetPermissionFlags::NoBan);
572+
NetPermissions::AddFlag(flags, NetPermissionFlags::Addr);
572573
}
573574
}
574575

test/functional/p2p_permissions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def run_test(self):
3333
# default permissions (no specific permissions)
3434
["-whitelist=127.0.0.1"],
3535
# Make sure the default values in the command line documentation match the ones here
36-
["relay", "noban", "mempool", "download"])
36+
["addr", "relay", "noban", "mempool", "download"])
3737

3838
self.checkpermission(
3939
# no permission (even with forcerelay)
@@ -43,14 +43,14 @@ def run_test(self):
4343
self.checkpermission(
4444
# relay permission removed (no specific permissions)
4545
["-whitelist=127.0.0.1", "-whitelistrelay=0"],
46-
["noban", "mempool", "download"])
46+
["addr", "noban", "mempool", "download"])
4747

4848
self.checkpermission(
4949
# forcerelay and relay permission added
5050
# Legacy parameter interaction which set whitelistrelay to true
5151
# if whitelistforcerelay is true
5252
["-whitelist=127.0.0.1", "-whitelistforcerelay"],
53-
["forcerelay", "relay", "noban", "mempool", "download"])
53+
["addr", "forcerelay", "relay", "noban", "mempool", "download"])
5454

5555
# Let's make sure permissions are merged correctly
5656
# For this, we need to use whitebind instead of bind

0 commit comments

Comments
 (0)