diff options
author | Jon Atack <jon@atack.com> | 2021-09-09 18:48:22 +0200 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2022-01-25 20:43:22 +0100 |
commit | 572393448b4d32f91b92edc84b4200ab52d62422 (patch) | |
tree | 853d70a4fc427391ff7389f51e5ab9cf178adbc0 /src/node/blockstorage.cpp | |
parent | 2e557ced2830fc54476e598d52225f1679205e7d (diff) |
Require CBlockIndex::GetUndoPos() to hold mutex cs_main
Diffstat (limited to 'src/node/blockstorage.cpp')
-rw-r--r-- | src/node/blockstorage.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index 526100f1b2..2c18ee0c7d 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -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__); } |