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
Lint
Lint Not Applicable
Unit
Tests Not Applicable