mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
Add missing cs_main locks when calling blockToJSON/blockheaderToJSON
This commit is contained in:
@@ -78,6 +78,7 @@ double GetDifficulty(const CBlockIndex* blockindex)
|
||||
|
||||
UniValue blockheaderToJSON(const CBlockIndex* blockindex)
|
||||
{
|
||||
AssertLockHeld(cs_main);
|
||||
UniValue result(UniValue::VOBJ);
|
||||
result.push_back(Pair("hash", blockindex->GetBlockHash().GetHex()));
|
||||
int confirmations = -1;
|
||||
@@ -106,6 +107,7 @@ UniValue blockheaderToJSON(const CBlockIndex* blockindex)
|
||||
|
||||
UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDetails)
|
||||
{
|
||||
AssertLockHeld(cs_main);
|
||||
UniValue result(UniValue::VOBJ);
|
||||
result.push_back(Pair("hash", blockindex->GetBlockHash().GetHex()));
|
||||
int confirmations = -1;
|
||||
|
||||
Reference in New Issue
Block a user