HomePhabricator

[bugfix] wallet: Fix duplicate fileid detection

Description

[bugfix] wallet: Fix duplicate fileid detection

Summary:

The implementation in current master can not detect if the file ID is
duplicate with flushed BerkeleyEnvironment. This PR would store the file
ID in a global variable g_fileids and release it when the
BerkeleyDatabase close. So it won't have to rely on a Db*.

Depends on D4884.

Backport of core PR14320:
https://github.com/bitcoin/bitcoin/pull/14320/files

Test Plan:

ninja all check
./test/functional/test_runner.py wallet_*

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

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

Details

Provenance
Chun Kuan Lee <ken2812221@gmail.com>Authored on Sep 25 2018, 13:56
FabienCommitted on Jan 10 2020, 21:05
FabienPushed on Jan 10 2020, 21:16
Reviewer
Restricted Project
Differential Revision
D4885: [bugfix] wallet: Fix duplicate fileid detection
Parents
rSTAGING3aa629787057: [wallet] Reopen CDBEnv after encryption instead of shutting down
Branches
Unknown
Tags
Unknown