2022-07-12 22:24:31 -04:00
|
|
|
// Copyright (c) 2022 The Bitcoin Core developers
|
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#ifndef BITCOIN_KERNEL_MEMPOOL_PERSIST_H
|
|
|
|
#define BITCOIN_KERNEL_MEMPOOL_PERSIST_H
|
|
|
|
|
2023-03-15 11:18:06 +01:00
|
|
|
#include <util/fs.h>
|
2022-07-12 22:24:31 -04:00
|
|
|
|
2022-03-09 12:37:19 -05:00
|
|
|
class Chainstate;
|
2022-07-12 22:24:31 -04:00
|
|
|
class CTxMemPool;
|
|
|
|
|
|
|
|
namespace kernel {
|
|
|
|
|
2023-04-13 10:26:17 +02:00
|
|
|
/** Dump the mempool to a file. */
|
2022-07-12 22:24:31 -04:00
|
|
|
bool DumpMempool(const CTxMemPool& pool, const fs::path& dump_path,
|
|
|
|
fsbridge::FopenFn mockable_fopen_function = fsbridge::fopen,
|
|
|
|
bool skip_file_commit = false);
|
|
|
|
|
2023-04-13 10:52:40 +02:00
|
|
|
struct ImportMempoolOptions {
|
|
|
|
fsbridge::FopenFn mockable_fopen_function{fsbridge::fopen};
|
|
|
|
};
|
2023-04-13 10:26:17 +02:00
|
|
|
/** Import the file and attempt to add its contents to the mempool. */
|
2022-07-12 22:24:31 -04:00
|
|
|
bool LoadMempool(CTxMemPool& pool, const fs::path& load_path,
|
2022-03-09 12:37:19 -05:00
|
|
|
Chainstate& active_chainstate,
|
2023-04-13 10:52:40 +02:00
|
|
|
ImportMempoolOptions&& opts);
|
2022-07-12 22:24:31 -04:00
|
|
|
|
|
|
|
} // namespace kernel
|
|
|
|
|
|
|
|
|
|
|
|
#endif // BITCOIN_KERNEL_MEMPOOL_PERSIST_H
|