Skip to content

Commit

Permalink
Merge pull request #6290
Browse files Browse the repository at this point in the history
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 5753988
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/rpcblockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,6 @@ UniValue gettxoutsetinfo(const UniValue& params, bool fHelp)
+ HelpExampleRpc("gettxoutsetinfo", "")
);

LOCK(cs_main);

UniValue ret(UniValue::VOBJ);

CCoinsStats stats;
Expand Down
5 changes: 4 additions & 1 deletion src/txdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5753988

Please sign in to comment.