diff options
| author | Wladimir J. van der Laan <[email protected]> | 2015-01-07 13:03:21 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2015-01-07 13:03:41 +0100 |
| commit | 7625f7ff943807288eec37c0a54334b21a98d84c (patch) | |
| tree | b6c34a7968b1dd4834cd4a5be87eda13d392ecd6 /src/main.cpp | |
| parent | Merge pull request #5535 (diff) | |
| parent | Catch LevelDB errors during flush (diff) | |
| download | discoin-7625f7ff943807288eec37c0a54334b21a98d84c.tar.xz discoin-7625f7ff943807288eec37c0a54334b21a98d84c.zip | |
Merge pull request #5597
e413457 Catch LevelDB errors during flush (Pieter Wuille)
02bced1 Bugfix: only track UTXO modification after lookup (Pieter Wuille)
Diffstat (limited to 'src/main.cpp')
| -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 fa2b56148..ca2734b76 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1887,6 +1887,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)) { @@ -1926,6 +1927,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; } |