Skip to content

Commit 0fcff54

Browse files
committed
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.
1 parent da039d2 commit 0fcff54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wallet/bdb.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ bool BerkeleyBatch::ReadKey(CDataStream&& key, CDataStream& value)
767767
bool BerkeleyBatch::WriteKey(CDataStream&& key, CDataStream&& value, bool overwrite)
768768
{
769769
if (!pdb)
770-
return true;
770+
return false;
771771
if (fReadOnly)
772772
assert(!"Write called on database in read-only mode");
773773

0 commit comments

Comments
 (0)