Page MenuHomePhabricator

Avoid opening copied wallet databases simultaneously
ClosedPublic

Authored by Fabien on Jan 9 2019, 21:00.

Details

Summary

Make sure wallet databases have unique fileids. If they don't, throw an
error.
BDB caches do not work properly when more than one open database has the
same fileid, because values written to one database may show up in reads
to other databases.

Bitcoin will never create different databases with the same fileid, but
users can create them by manually copying database files.

Backport of core PR11476

Depends on D2278

Test Plan
make check
./test/functional/test_runner.py multiwallet

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.Jan 9 2019, 21:00
Herald added a reviewer: Restricted Project. · View Herald TranscriptJan 9 2019, 21:00
Herald added a subscriber: schancel. · View Herald Transcript
deadalnix accepted this revision.Jan 11 2019, 00:45
This revision is now accepted and ready to land.Jan 11 2019, 00:45
Closed by commit rABC840006976c43: Avoid opening copied wallet databases simultaneously (authored by Russell Yanofsky <russ@yanofsky.org>, committed by Fabien). · Explain WhyJan 11 2019, 15:12
This revision was automatically updated to reflect the committed changes.