Page MenuHomePhabricator

wallet: Reset BerkeleyDB handle after connection fails
ClosedPublic

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

Details

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
Branch
PR13161
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 8831
Build 15637: Default Diff Build & Tests
Build 15636: arc lint + arc unit