Merge pull request #6290

57092ed rpc: make `gettxoutsettinfo` run lock-free (Wladimir J. van der Laan)
This commit is contained in:
Wladimir J. van der Laan committed 2015-06-19 17:42:50 +02:00
commit 57539884f2
2 files changed
+4 -3

No files matched your search

-2
View File
@@ -345,8 +345,6 @@ UniValue gettxoutsetinfo(const UniValue& params, bool fHelp)
+ HelpExampleRpc("gettxoutsetinfo", "")
);
LOCK(cs_main);
UniValue ret(UniValue::VOBJ);
CCoinsStats stats;
+4 -1
View File
@@ -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;