diff options
| author | James O'Beirne <[email protected]> | 2019-07-24 13:39:42 -0400 |
|---|---|---|
| committer | James O'Beirne <[email protected]> | 2019-08-15 11:19:40 -0400 |
| commit | 582d2cd74754d6b9a2394616a9c82a89d2d71976 (patch) | |
| tree | 6aca21d9b8481b465a74811fb9c2b97ddc9576c4 /src/init.cpp | |
| parent | refactor: have CCoins* data managed under CChainState (diff) | |
| download | discoin-582d2cd74754d6b9a2394616a9c82a89d2d71976.tar.xz discoin-582d2cd74754d6b9a2394616a9c82a89d2d71976.zip | |
Cover UTXO set access with lock annotations
i.e. any CoinsViews members. Adds a lock acquisition to `gettxoutsetinfo` RPC
to comply with added annotations.
Co-authored-by: Russell Yanofsky <[email protected]>
Diffstat (limited to 'src/init.cpp')
| -rw-r--r-- | src/init.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp index 50ae0c625..97be4637a 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -235,8 +235,11 @@ void Shutdown(InitInterfaces& interfaces) // // g_chainstate is referenced here directly (instead of ::ChainstateActive()) because it // may not have been initialized yet. - if (g_chainstate && g_chainstate->CanFlushToDisk()) { - g_chainstate->ForceFlushStateToDisk(); + { + LOCK(cs_main); + if (g_chainstate && g_chainstate->CanFlushToDisk()) { + g_chainstate->ForceFlushStateToDisk(); + } } // After there are no more peers/RPC left to give us new data which may generate |