Removed main.h dependency from rpcserver.cpp
Rebased by @laanwj:
- update for RPC methods added since 84d13ee: setmocktime,
invalidateblock, reconsiderblock. Only the first, setmocktime, required a change,
the other two are thread safe.
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
6b5f5294bb
commit
4401b2d7c5
@@ -91,6 +91,8 @@ Value importprivkey(const Array& params, bool fHelp)
|
||||
+ HelpExampleRpc("importprivkey", "\"mykey\", \"testing\", false")
|
||||
);
|
||||
|
||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||
|
||||
EnsureWalletIsUnlocked();
|
||||
|
||||
string strSecret = params[0].get_str();
|
||||
@@ -158,6 +160,8 @@ Value importaddress(const Array& params, bool fHelp)
|
||||
+ HelpExampleRpc("importaddress", "\"myaddress\", \"testing\", false")
|
||||
);
|
||||
|
||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||
|
||||
CScript script;
|
||||
|
||||
CBitcoinAddress address(params[0].get_str());
|
||||
@@ -223,6 +227,8 @@ Value importwallet(const Array& params, bool fHelp)
|
||||
+ HelpExampleRpc("importwallet", "\"test\"")
|
||||
);
|
||||
|
||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||
|
||||
EnsureWalletIsUnlocked();
|
||||
|
||||
ifstream file;
|
||||
@@ -322,6 +328,8 @@ Value dumpprivkey(const Array& params, bool fHelp)
|
||||
+ HelpExampleRpc("dumpprivkey", "\"myaddress\"")
|
||||
);
|
||||
|
||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||
|
||||
EnsureWalletIsUnlocked();
|
||||
|
||||
string strAddress = params[0].get_str();
|
||||
@@ -351,6 +359,8 @@ Value dumpwallet(const Array& params, bool fHelp)
|
||||
+ HelpExampleRpc("dumpwallet", "\"test\"")
|
||||
);
|
||||
|
||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||
|
||||
EnsureWalletIsUnlocked();
|
||||
|
||||
ofstream file;
|
||||
|
||||
Reference in New Issue
Block a user