aboutsummaryrefslogtreecommitdiff
path: root/src/test/validation_chainstatemanager_tests.cpp
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@pm.me>2022-02-02 09:47:13 -0500
committerJames O'Beirne <james.obeirne@pm.me>2022-09-13 13:30:25 -0400
commit8153bd9247dad3982d54488bcdb3960470315290 (patch)
tree294d32393ae48eadc6238952ef8e2bfb38a03d0d /src/test/validation_chainstatemanager_tests.cpp
parentad67ff377c2b271cb4683da2fb25fd295557f731 (diff)
blockmanager: avoid undefined behavior during FlushBlockFile
If we call FlushBlockFile() without having intitialized the block index with LoadBlockIndexDB(), we may be indexing into an empty vector. Specifically this is an issue when we call MaybeRebalanceCaches() during chainstate init before the block index has been loaded, which calls FlushBlockFile(). Also add an assert to avoid undefined behavior. Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
Diffstat (limited to 'src/test/validation_chainstatemanager_tests.cpp')
0 files changed, 0 insertions, 0 deletions