diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2015-01-04 19:11:44 +0100 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2015-01-04 19:12:00 +0100 |
commit | e41345790f1041f5c5e5605d73a0af174769aa55 (patch) | |
tree | 29e3cd103949ed3d0d0ea092c5f6dc2d7c964503 /src | |
parent | 02bced16615f072b1d9960e7e5027b6eb4f41384 (diff) |
Catch LevelDB errors during flush
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 2410230ef4..6bc1cefede 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1807,6 +1807,7 @@ enum FlushStateMode { bool static FlushStateToDisk(CValidationState &state, FlushStateMode mode) { LOCK(cs_main); static int64_t nLastWrite = 0; + try { if ((mode == FLUSH_STATE_ALWAYS) || ((mode == FLUSH_STATE_PERIODIC || mode == FLUSH_STATE_IF_NEEDED) && pcoinsTip->GetCacheSize() > nCoinCacheSize) || (mode == FLUSH_STATE_PERIODIC && GetTimeMicros() > nLastWrite + DATABASE_WRITE_INTERVAL * 1000000)) { @@ -1846,6 +1847,9 @@ bool static FlushStateToDisk(CValidationState &state, FlushStateMode mode) { } nLastWrite = GetTimeMicros(); } + } catch (const std::runtime_error& e) { + return state.Abort(std::string("System error while flushing: ") + e.what()); + } return true; } |