mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Require CBlockIndex::GetUndoPos() to hold mutex cs_main
This commit is contained in:
@@ -513,7 +513,8 @@ static bool UndoWriteToDisk(const CBlockUndo& blockundo, FlatFilePos& pos, const
|
||||
|
||||
bool UndoReadFromDisk(CBlockUndo& blockundo, const CBlockIndex* pindex)
|
||||
{
|
||||
FlatFilePos pos = pindex->GetUndoPos();
|
||||
const FlatFilePos pos{WITH_LOCK(::cs_main, return pindex->GetUndoPos())};
|
||||
|
||||
if (pos.IsNull()) {
|
||||
return error("%s: no undo data available", __func__);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user