HomePhabricator

Avoid opening copied wallet databases simultaneously

Description

Avoid opening copied wallet databases simultaneously

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

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: teamcity, schancel

Differential Revision: https://reviews.bitcoinabc.org/D2281

Details

Provenance
Russell Yanofsky <russ@yanofsky.org>Authored on Oct 10 2017, 19:27
FabienCommitted on Jan 11 2019, 15:12
FabienPushed on Jan 11 2019, 15:21
Reviewer
Restricted Project
Differential Revision
D2281: Avoid opening copied wallet databases simultaneously
Parents
rSTAGINGf06241f87ef1: Fix check-doc.py
Branches
Unknown
Tags
Unknown
References
tag: phabricator/base/6615, tag: phabricator/base/6613, tag: phabricator/base/6609