mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-26 05:48:20 +01:00
walletdb: Add MakeBatch function to BerkeleyDatabase and use it
Instead of having WalletBatch construct the BerkeleyBatch, have BerkeleyDatabase do it and return a std::unique_ptr<BerkeleyBatch>
This commit is contained in:
@@ -841,3 +841,8 @@ bool BerkeleyBatch::HasKey(CDataStream&& key)
|
||||
int ret = pdb->exists(activeTxn, datKey, 0);
|
||||
return ret == 0;
|
||||
}
|
||||
|
||||
std::unique_ptr<BerkeleyBatch> BerkeleyDatabase::MakeBatch(const char* mode, bool flush_on_close)
|
||||
{
|
||||
return MakeUnique<BerkeleyBatch>(*this, mode, flush_on_close);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user