Page MenuHomePhabricator

wallet: Reset BerkeleyDB handle after connection fails
ClosedPublic

Authored by Fabien on Fri, Jan 10, 15:35.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABCf897b4f5e8f8: wallet: Reset BerkeleyDB handle after connection fails
Summary
According to the BerkeleyDB docs, the DbEnv handle may not be accessed
after close() has been called. This change ensures that we create a new
handle after close() is called. This avoids a segfault when the first
connection attempt fails and then a second connection attempt tries to
call open() on the already closed DbEnv handle.

Backport of core PR13161.

Test Plan
ninja check
./test/functional/test_runner.py feature_dbcrash

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Fri, Jan 10, 15:35
Herald added a reviewer: Restricted Project. · View Herald TranscriptFri, Jan 10, 15:35
deadalnix accepted this revision.Fri, Jan 10, 15:42
This revision is now accepted and ready to land.Fri, Jan 10, 15:42