mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Merge #8996: Network activity toggle
19f46f1Qt: New network_disabled icon (Luke Dashjr)54cf997RPC/Net: Use boolean consistently for networkactive, and remove from getinfo (Luke Dashjr)b2b33d9Overhaul network activity toggle (Jonas Schnelli)32efa79Qt: Add GUI feedback and control of network activity state. (Jon Lund Steffensen)e38993bRPC: Add "togglenetwork" method to toggle network activity temporarily (Jon Lund Steffensen)7c9a98aAllow network activity to be temporarily suspended. (Jon Lund Steffensen)
This commit is contained in:
@@ -84,6 +84,28 @@ BOOST_AUTO_TEST_CASE(rpc_rawparams)
|
||||
BOOST_CHECK_THROW(CallRPC(string("sendrawtransaction ")+rawtx+" extra"), runtime_error);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(rpc_togglenetwork)
|
||||
{
|
||||
UniValue r;
|
||||
|
||||
r = CallRPC("getnetworkinfo");
|
||||
bool netState = find_value(r.get_obj(), "networkactive").get_bool();
|
||||
BOOST_CHECK_EQUAL(netState, true);
|
||||
|
||||
BOOST_CHECK_NO_THROW(CallRPC("setnetworkactive false"));
|
||||
r = CallRPC("getnetworkinfo");
|
||||
int numConnection = find_value(r.get_obj(), "connections").get_int();
|
||||
BOOST_CHECK_EQUAL(numConnection, 0);
|
||||
|
||||
netState = find_value(r.get_obj(), "networkactive").get_bool();
|
||||
BOOST_CHECK_EQUAL(netState, false);
|
||||
|
||||
BOOST_CHECK_NO_THROW(CallRPC("setnetworkactive true"));
|
||||
r = CallRPC("getnetworkinfo");
|
||||
netState = find_value(r.get_obj(), "networkactive").get_bool();
|
||||
BOOST_CHECK_EQUAL(netState, true);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(rpc_rawsign)
|
||||
{
|
||||
UniValue r;
|
||||
|
||||
Reference in New Issue
Block a user