mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Merge pull request #5597
e413457Catch LevelDB errors during flush (Pieter Wuille)02bced1Bugfix: only track UTXO modification after lookup (Pieter Wuille)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user