Avoid opening copied wallet databases simultaneously
commit478a89c1ef79a75275d1b508122c06eee9386b2d
authorRussell Yanofsky <russ@yanofsky.org>
Tue, 10 Oct 2017 19:27:26 +0000 (10 15:27 -0400)
committerRussell Yanofsky <russ@yanofsky.org>
Thu, 19 Oct 2017 13:01:43 +0000 (19 09:01 -0400)
tree9537bcd85ca45299d363560f1a6dbb6847907919
parent13f53b750dc09cb59192b2aa4ac8e499ee36e1ca
Avoid opening copied wallet databases simultaneously

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.

BDB caching bug was reported by Chris Moore <dooglus@gmail.com>
https://github.com/bitcoin/bitcoin/issues/11429

Fixes #11429
src/wallet/db.cpp
test/functional/multiwallet.py