Browse Source

Merge pull request #6290

57092ed rpc: make `gettxoutsettinfo` run lock-free (Wladimir J. van der Laan)
0.13
Wladimir J. van der Laan 10 years ago
parent
commit
57539884f2
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 2
      src/rpcblockchain.cpp
  2. 5
      src/txdb.cpp

2
src/rpcblockchain.cpp

@ -345,8 +345,6 @@ UniValue gettxoutsetinfo(const UniValue& params, bool fHelp) @@ -345,8 +345,6 @@ UniValue gettxoutsetinfo(const UniValue& params, bool fHelp)
+ HelpExampleRpc("gettxoutsetinfo", "")
);
LOCK(cs_main);
UniValue ret(UniValue::VOBJ);
CCoinsStats stats;

5
src/txdb.cpp

@ -147,7 +147,10 @@ bool CCoinsViewDB::GetStats(CCoinsStats &stats) const { @@ -147,7 +147,10 @@ bool CCoinsViewDB::GetStats(CCoinsStats &stats) const {
return error("%s: Deserialize or I/O error - %s", __func__, e.what());
}
}
stats.nHeight = mapBlockIndex.find(GetBestBlock())->second->nHeight;
{
LOCK(cs_main);
stats.nHeight = mapBlockIndex.find(stats.hashBlock)->second->nHeight;
}
stats.hashSerialized = ss.GetHash();
stats.nTotalAmount = nTotalAmount;
return true;

Loading…
Cancel
Save