diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp index 047df48fd4c7d..ca6b066e7ee21 100644 --- a/src/wallet/db.cpp +++ b/src/wallet/db.cpp @@ -796,6 +796,7 @@ void CWalletDBWrapper::Flush(bool shutdown) { if (!IsDummy()) { env->Flush(shutdown); + if (shutdown) env = nullptr; } }