Permalink
Browse files

Merge pull request #6290

57092ed rpc: make `gettxoutsettinfo` run lock-free (Wladimir J. van der Laan)
  • Loading branch information...
laanwj committed Jun 19, 2015
2 parents 7ecdcd9 + 57092ed commit 57539884f2097077c44f0abc13bc46629ab6249b
Showing with 4 additions and 3 deletions.
  1. +0 −2 src/rpcblockchain.cpp
  2. +4 −1 src/txdb.cpp
View
@@ -345,8 +345,6 @@ UniValue gettxoutsetinfo(const UniValue& params, bool fHelp)
+ HelpExampleRpc("gettxoutsetinfo", "")
);
- LOCK(cs_main);
-
UniValue ret(UniValue::VOBJ);
CCoinsStats stats;
View
@@ -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;

0 comments on commit 5753988

Please sign in to comment.