Skip to content

Commit d2c8d16

Browse files
committed
Merge bitcoin/bitcoin#30344: kernel: remove mempool_persist
f1478c0 mempool: move LoadMempool/DumpMempool to node (Cory Fields) 6d242ff kernel: remove mempool_persist.cpp (Cory Fields) Pull request description: DumpMempool/LoadMempool are not necessary for the kernel. Noticed while working on instantiated logging. I suppose these could have been left in on purpose, but I'm assuming it was probably just an oversight. ACKs for top commit: TheCharlatan: Re-ACK f1478c0 glozow: ACK f1478c0 stickies-v: ACK f1478c0 Tree-SHA512: 5825da0cf2e67470524eb6ebe397eb90755a368469a25f184df99ab935b3eb6d89eb802b41a6c3661e869bba3bbfa8ba9d95281bc75ebbf790ec5d9d1f79c66f
2 parents 04d63fb + f1478c0 commit d2c8d16

File tree

6 files changed

+20
-21
lines changed

6 files changed

+20
-21
lines changed

src/Makefile.am

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ BITCOIN_CORE_H = \
192192
kernel/mempool_entry.h \
193193
kernel/mempool_limits.h \
194194
kernel/mempool_options.h \
195-
kernel/mempool_persist.h \
196195
kernel/mempool_removal_reason.h \
197196
kernel/messagestartchars.h \
198197
kernel/notifications_interface.h \
@@ -228,6 +227,7 @@ BITCOIN_CORE_H = \
228227
node/interface_ui.h \
229228
node/kernel_notifications.h \
230229
node/mempool_args.h \
230+
node/mempool_persist.h \
231231
node/mempool_persist_args.h \
232232
node/miner.h \
233233
node/mini_miner.h \
@@ -413,7 +413,6 @@ libbitcoin_node_a_SOURCES = \
413413
kernel/context.cpp \
414414
kernel/cs_main.cpp \
415415
kernel/disconnected_transactions.cpp \
416-
kernel/mempool_persist.cpp \
417416
kernel/mempool_removal_reason.cpp \
418417
mapport.cpp \
419418
net.cpp \
@@ -435,6 +434,7 @@ libbitcoin_node_a_SOURCES = \
435434
node/interfaces.cpp \
436435
node/kernel_notifications.cpp \
437436
node/mempool_args.cpp \
437+
node/mempool_persist.cpp \
438438
node/mempool_persist_args.cpp \
439439
node/miner.cpp \
440440
node/mini_miner.cpp \
@@ -950,7 +950,6 @@ libbitcoinkernel_la_SOURCES = \
950950
kernel/context.cpp \
951951
kernel/cs_main.cpp \
952952
kernel/disconnected_transactions.cpp \
953-
kernel/mempool_persist.cpp \
954953
kernel/mempool_removal_reason.cpp \
955954
logging.cpp \
956955
node/blockstorage.cpp \

src/init.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <init.h>
99

1010
#include <kernel/checks.h>
11-
#include <kernel/mempool_persist.h>
1211
#include <kernel/validation_cache_sizes.h>
1312

1413
#include <addrman.h>
@@ -51,6 +50,7 @@
5150
#include <node/interface_ui.h>
5251
#include <node/kernel_notifications.h>
5352
#include <node/mempool_args.h>
53+
#include <node/mempool_persist.h>
5454
#include <node/mempool_persist_args.h>
5555
#include <node/miner.h>
5656
#include <node/peerman_args.h>
@@ -119,8 +119,6 @@
119119
using common::AmountErrMsg;
120120
using common::InvalidPortErrMsg;
121121
using common::ResolveErrMsg;
122-
using kernel::DumpMempool;
123-
using kernel::LoadMempool;
124122
using kernel::ValidationCacheSizes;
125123

126124
using node::ApplyArgsManOptions;
@@ -130,6 +128,8 @@ using node::CalculateCacheSizes;
130128
using node::DEFAULT_PERSIST_MEMPOOL;
131129
using node::DEFAULT_PRINTPRIORITY;
132130
using node::DEFAULT_STOPATHEIGHT;
131+
using node::DumpMempool;
132+
using node::LoadMempool;
133133
using node::KernelNotifications;
134134
using node::LoadChainstate;
135135
using node::MempoolPath;

src/kernel/mempool_persist.cpp renamed to src/node/mempool_persist.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#include <kernel/mempool_persist.h>
5+
#include <node/mempool_persist.h>
66

77
#include <clientversion.h>
88
#include <consensus/amount.h>
@@ -33,7 +33,7 @@
3333

3434
using fsbridge::FopenFn;
3535

36-
namespace kernel {
36+
namespace node {
3737

3838
static const uint64_t MEMPOOL_DUMP_VERSION_NO_XOR_KEY{1};
3939
static const uint64_t MEMPOOL_DUMP_VERSION{2};
@@ -218,4 +218,4 @@ bool DumpMempool(const CTxMemPool& pool, const fs::path& dump_path, FopenFn mock
218218
return true;
219219
}
220220

221-
} // namespace kernel
221+
} // namespace node

src/kernel/mempool_persist.h renamed to src/node/mempool_persist.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#ifndef BITCOIN_KERNEL_MEMPOOL_PERSIST_H
6-
#define BITCOIN_KERNEL_MEMPOOL_PERSIST_H
5+
#ifndef BITCOIN_NODE_MEMPOOL_PERSIST_H
6+
#define BITCOIN_NODE_MEMPOOL_PERSIST_H
77

88
#include <util/fs.h>
99

1010
class Chainstate;
1111
class CTxMemPool;
1212

13-
namespace kernel {
13+
namespace node {
1414

1515
/** Dump the mempool to a file. */
1616
bool DumpMempool(const CTxMemPool& pool, const fs::path& dump_path,
@@ -28,7 +28,7 @@ bool LoadMempool(CTxMemPool& pool, const fs::path& load_path,
2828
Chainstate& active_chainstate,
2929
ImportMempoolOptions&& opts);
3030

31-
} // namespace kernel
31+
} // namespace node
3232

3333

34-
#endif // BITCOIN_KERNEL_MEMPOOL_PERSIST_H
34+
#endif // BITCOIN_NODE_MEMPOOL_PERSIST_H

src/rpc/mempool.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include <rpc/blockchain.h>
77

8-
#include <kernel/mempool_persist.h>
8+
#include <node/mempool_persist.h>
99

1010
#include <chainparams.h>
1111
#include <core_io.h>
@@ -27,7 +27,7 @@
2727

2828
#include <utility>
2929

30-
using kernel::DumpMempool;
30+
using node::DumpMempool;
3131

3232
using node::DEFAULT_MAX_BURN_AMOUNT;
3333
using node::DEFAULT_MAX_RAW_TX_FEE_RATE;
@@ -759,13 +759,13 @@ static RPCHelpMan importmempool()
759759
const UniValue& use_current_time{request.params[1]["use_current_time"]};
760760
const UniValue& apply_fee_delta{request.params[1]["apply_fee_delta_priority"]};
761761
const UniValue& apply_unbroadcast{request.params[1]["apply_unbroadcast_set"]};
762-
kernel::ImportMempoolOptions opts{
762+
node::ImportMempoolOptions opts{
763763
.use_current_time = use_current_time.isNull() ? true : use_current_time.get_bool(),
764764
.apply_fee_delta_priority = apply_fee_delta.isNull() ? false : apply_fee_delta.get_bool(),
765765
.apply_unbroadcast_set = apply_unbroadcast.isNull() ? false : apply_unbroadcast.get_bool(),
766766
};
767767

768-
if (!kernel::LoadMempool(mempool, load_path, chainstate, std::move(opts))) {
768+
if (!node::LoadMempool(mempool, load_path, chainstate, std::move(opts))) {
769769
throw JSONRPCError(RPC_MISC_ERROR, "Unable to import mempool file, see debug.log for details.");
770770
}
771771

src/test/fuzz/validation_load_mempool.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#include <kernel/mempool_persist.h>
5+
#include <node/mempool_persist.h>
66

77
#include <node/mempool_args.h>
88
#include <node/mempool_persist_args.h>
@@ -21,8 +21,8 @@
2121
#include <cstdint>
2222
#include <vector>
2323

24-
using kernel::DumpMempool;
25-
using kernel::LoadMempool;
24+
using node::DumpMempool;
25+
using node::LoadMempool;
2626

2727
using node::MempoolPath;
2828

0 commit comments

Comments
 (0)