aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-07-09 10:07:47 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-07-22 22:55:11 +0300
commit62fe6aa87e4cdd8b06207abc1387c68d7bfc04c1 (patch)
tree93b7d18a4ca1be760b3ba50eaaa727883d2b99c8 /src/net.cpp
parentf7c19e829eca10ce8b4acafc61264f8bb9b922f3 (diff)
downloadbitcoin-62fe6aa87e4cdd8b06207abc1387c68d7bfc04c1.tar.xz
net: Add -networkactive option
The `setnetworkactive' RPC command is already present. This new option allows to start the client with disabled p2p network activity for testing or reindexing.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 21d340b516..aa0486f0fb 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -2262,12 +2262,14 @@ void CConnman::SetNetworkActive(bool active)
uiInterface.NotifyNetworkActiveChanged(fNetworkActive);
}
-CConnman::CConnman(uint64_t nSeed0In, uint64_t nSeed1In) : nSeed0(nSeed0In), nSeed1(nSeed1In)
+CConnman::CConnman(uint64_t nSeed0In, uint64_t nSeed1In, bool network_active)
+ : nSeed0(nSeed0In), nSeed1(nSeed1In)
{
SetTryNewOutboundPeer(false);
Options connOptions;
Init(connOptions);
+ SetNetworkActive(network_active);
}
NodeId CConnman::GetNewNodeId()