File tree Expand file tree Collapse file tree 4 files changed +16
-8
lines changed Expand file tree Collapse file tree 4 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -909,8 +909,8 @@ void CConnman::AcceptConnection(const ListenSocket& hListenSocket) {
909
909
bool legacyWhitelisted = false ;
910
910
if (NetPermissions::HasFlag (permissionFlags, NetPermissionFlags::PF_ISIMPLICIT)) {
911
911
NetPermissions::ClearFlag (permissionFlags, PF_ISIMPLICIT);
912
- if (gArgs .GetBoolArg (" -whitelistforcerelay" , false )) NetPermissions::AddFlag (permissionFlags, PF_FORCERELAY);
913
- if (gArgs .GetBoolArg (" -whitelistrelay" , false )) NetPermissions::AddFlag (permissionFlags, PF_RELAY);
912
+ if (gArgs .GetBoolArg (" -whitelistforcerelay" , DEFAULT_WHITELISTFORCERELAY )) NetPermissions::AddFlag (permissionFlags, PF_FORCERELAY);
913
+ if (gArgs .GetBoolArg (" -whitelistrelay" , DEFAULT_WHITELISTRELAY )) NetPermissions::AddFlag (permissionFlags, PF_RELAY);
914
914
NetPermissions::AddFlag (permissionFlags, PF_MEMPOOL);
915
915
NetPermissions::AddFlag (permissionFlags, PF_NOBAN);
916
916
legacyWhitelisted = true ;
Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ class CScheduler;
40
40
class CNode ;
41
41
class BanMan ;
42
42
43
+ /* * Default for -whitelistrelay. */
44
+ static const bool DEFAULT_WHITELISTRELAY = true ;
45
+ /* * Default for -whitelistforcerelay. */
46
+ static const bool DEFAULT_WHITELISTFORCERELAY = false ;
47
+
43
48
/* * Time between pings automatically sent out for latency probing and keepalive (in seconds). */
44
49
static const int PING_INTERVAL = 2 * 60 ;
45
50
/* * Time after which to disconnect, after waiting for a ping response (or inactivity). */
Original file line number Diff line number Diff line change @@ -50,10 +50,6 @@ struct DisconnectedBlockTransactions;
50
50
struct PrecomputedTransactionData ;
51
51
struct LockPoints ;
52
52
53
- /* * Default for -whitelistrelay. */
54
- static const bool DEFAULT_WHITELISTRELAY = true ;
55
- /* * Default for -whitelistforcerelay. */
56
- static const bool DEFAULT_WHITELISTFORCERELAY = false ;
57
53
/* * Default for -minrelaytxfee, minimum relay fee for transactions */
58
54
static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 1000 ;
59
55
/* * Default for -limitancestorcount, max number of in-mempool ancestors */
Original file line number Diff line number Diff line change @@ -22,12 +22,19 @@ def set_test_params(self):
22
22
self .extra_args = [[],[]]
23
23
24
24
def run_test (self ):
25
+
25
26
self .checkpermission (
26
- # relay permission added
27
- ["-whitelist=127.0.0.1" , "-whitelistrelay" ],
27
+ # default permissions (no specific permissions)
28
+ ["-whitelist=127.0.0.1" ],
28
29
["relay" , "noban" , "mempool" ],
29
30
True )
30
31
32
+ self .checkpermission (
33
+ # relay permission removed (no specific permissions)
34
+ ["-whitelist=127.0.0.1" , "-whitelistrelay=0" ],
35
+ ["noban" , "mempool" ],
36
+ True )
37
+
31
38
self .checkpermission (
32
39
# forcerelay and relay permission added
33
40
# Legacy parameter interaction which set whitelistrelay to true
You can’t perform that action at this time.
0 commit comments