Merge #11476: Avoid opening copied wallet databases simultaneously
commit99e93de6f8ab4fcaa244686bb047d184e74c3e27
authorWladimir J. van der Laan <laanwj@gmail.com>
Thu, 19 Oct 2017 16:12:59 +0000 (19 18:12 +0200)
committerWladimir J. van der Laan <laanwj@gmail.com>
Thu, 19 Oct 2017 16:16:46 +0000 (19 18:16 +0200)
tree9537bcd85ca45299d363560f1a6dbb6847907919
parent13f53b750dc09cb59192b2aa4ac8e499ee36e1ca
parent478a89c1ef79a75275d1b508122c06eee9386b2d
Merge #11476: Avoid opening copied wallet databases simultaneously

478a89c Avoid opening copied wallet databases simultaneously (Russell Yanofsky)

Pull request description:

  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 @dooglus in https://github.com/bitcoin/bitcoin/issues/11429

Tree-SHA512: e7635dc81a181801f42324b72fe9e0a2a7dd00b1dcf5abcbf27fa50938eb9a1fc3065c2321326c3456c48c29ae6504353b02f3d46e6eb2f7b09e46d8fe24388d