Page MenuHomePhabricator

wallet: Move BerkeleyBatch static functions to BerkeleyDatabase
ClosedPublic

Authored by Fabien on Dec 7 2020, 13:24.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable