From 0fcff547d5b47822c13104978fda0c486e596526 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Thu, 18 Jun 2020 11:28:39 -0400 Subject: [PATCH] walletdb: Ensure that having no database handle is a failure Previously having no database handle could still be considered a success when BerkeleyDatabase and BerkeleyBatch were used for dummy database things. With dedicated DummyDatabase and DummyBatch classes now, these should fail. --- src/wallet/bdb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/bdb.cpp b/src/wallet/bdb.cpp index 3178a7b47a..a04311fdf5 100644 --- a/src/wallet/bdb.cpp +++ b/src/wallet/bdb.cpp @@ -767,7 +767,7 @@ bool BerkeleyBatch::ReadKey(CDataStream&& key, CDataStream& value) bool BerkeleyBatch::WriteKey(CDataStream&& key, CDataStream&& value, bool overwrite) { if (!pdb) - return true; + return false; if (fReadOnly) assert(!"Write called on database in read-only mode");