HomePhabricator

wallet: Move BerkeleyBatch static functions to BerkeleyDatabase

Description

wallet: Move BerkeleyBatch static functions to BerkeleyDatabase

Summary:

The BerkeleyBatch class has 4 static functions that operate on
BerkeleyDatabase or BerkeleyEnvironment. It doesn't make sense for these
to be standalone nor for them to be static functions. So instead, move
them from BerkeleyBatch into BerkeleyDatabase and make them member
functions instead of static.

BerkeleyBatch::VerifyEnvironment and BerkeleyBatch::VerifyDatabaseFile
are combined into a single BerkeleyDatabase::Verify function that
operates on that BerkeleyDatabase object.

BerkeleyBatch::Rewrite and BerkeleyBatch::PeriodicFlush both took a
BerkeleyDatabase as an argument and did stuff on it. So we just make it
a member function so it doesn't need to take a database as an argument.

Backport of core PR19324.

Depends on D8616.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

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

Details

Provenance
Andrew Chow <achow101-github@achow101.com>Authored on Jun 15 2020, 18:37
FabienCommitted on Dec 7 2020, 16:03
FabienPushed on Dec 7 2020, 16:04
Reviewer
Restricted Project
Differential Revision
D8617: wallet: Move BerkeleyBatch static functions to BerkeleyDatabase
Parents
rABC4a00dfee75c0: wallet: Remove boost from PeriodicFlush
Branches
Unknown
Tags
Unknown