Auto merge of #4992 - LarryRuane:upstream-locking-0.11, r=str4d
Bitcoin 0.12 locking PRs These are locking changes from upstream (bitcoin core) release 0.12. - bitcoin/bitcoin#7013 - bitcoin/bitcoin#7156 - bitcoin/bitcoin#7229
This commit is contained in:
commit
b08c673ddd
|
@ -573,7 +573,6 @@ UniValue createrawtransaction(const UniValue& params, bool fHelp)
|
||||||
+ HelpExampleRpc("createrawtransaction", "\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\", \"{\\\"address\\\":0.01}\"")
|
+ HelpExampleRpc("createrawtransaction", "\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\", \"{\\\"address\\\":0.01}\"")
|
||||||
);
|
);
|
||||||
|
|
||||||
LOCK(cs_main);
|
|
||||||
RPCTypeCheck(params, boost::assign::list_of(UniValue::VARR)(UniValue::VOBJ)(UniValue::VNUM)(UniValue::VNUM), true);
|
RPCTypeCheck(params, boost::assign::list_of(UniValue::VARR)(UniValue::VOBJ)(UniValue::VNUM)(UniValue::VNUM), true);
|
||||||
if (params[0].isNull() || params[1].isNull())
|
if (params[0].isNull() || params[1].isNull())
|
||||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, arguments 1 and 2 must be non-null");
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, arguments 1 and 2 must be non-null");
|
||||||
|
@ -581,7 +580,11 @@ UniValue createrawtransaction(const UniValue& params, bool fHelp)
|
||||||
UniValue inputs = params[0].get_array();
|
UniValue inputs = params[0].get_array();
|
||||||
UniValue sendTo = params[1].get_obj();
|
UniValue sendTo = params[1].get_obj();
|
||||||
|
|
||||||
int nextBlockHeight = chainActive.Height() + 1;
|
int nextBlockHeight;
|
||||||
|
{
|
||||||
|
LOCK(cs_main);
|
||||||
|
nextBlockHeight = chainActive.Height() + 1;
|
||||||
|
}
|
||||||
CMutableTransaction rawTx = CreateNewContextualCMutableTransaction(
|
CMutableTransaction rawTx = CreateNewContextualCMutableTransaction(
|
||||||
Params().GetConsensus(), nextBlockHeight);
|
Params().GetConsensus(), nextBlockHeight);
|
||||||
|
|
||||||
|
@ -779,7 +782,6 @@ UniValue decodescript(const UniValue& params, bool fHelp)
|
||||||
+ HelpExampleRpc("decodescript", "\"hexstring\"")
|
+ HelpExampleRpc("decodescript", "\"hexstring\"")
|
||||||
);
|
);
|
||||||
|
|
||||||
LOCK(cs_main);
|
|
||||||
RPCTypeCheck(params, boost::assign::list_of(UniValue::VSTR));
|
RPCTypeCheck(params, boost::assign::list_of(UniValue::VSTR));
|
||||||
|
|
||||||
UniValue r(UniValue::VOBJ);
|
UniValue r(UniValue::VOBJ);
|
||||||
|
|
|
@ -1248,8 +1248,13 @@ bool CWalletDB::Recover(CDBEnv& dbenv, const std::string& filename, bool fOnlyKe
|
||||||
CDataStream ssKey(row.first, SER_DISK, CLIENT_VERSION);
|
CDataStream ssKey(row.first, SER_DISK, CLIENT_VERSION);
|
||||||
CDataStream ssValue(row.second, SER_DISK, CLIENT_VERSION);
|
CDataStream ssValue(row.second, SER_DISK, CLIENT_VERSION);
|
||||||
string strType, strErr;
|
string strType, strErr;
|
||||||
bool fReadOK = ReadKeyValue(&dummyWallet, ssKey, ssValue,
|
bool fReadOK;
|
||||||
|
{
|
||||||
|
// Required in LoadKeyMetadata():
|
||||||
|
LOCK(dummyWallet.cs_wallet);
|
||||||
|
fReadOK = ReadKeyValue(&dummyWallet, ssKey, ssValue,
|
||||||
wss, strType, strErr);
|
wss, strType, strErr);
|
||||||
|
}
|
||||||
if (!IsKeyType(strType))
|
if (!IsKeyType(strType))
|
||||||
continue;
|
continue;
|
||||||
if (!fReadOK)
|
if (!fReadOK)
|
||||||
|
|
Loading…
Reference in New Issue