aboutsummaryrefslogtreecommitdiff
path: root/src/bench/block_assemble.cpp
diff options
context:
space:
mode:
authorgzhao408 <gzhao408@berkeley.edu>2021-01-19 05:29:40 -0800
committergzhao408 <gzhao408@berkeley.edu>2021-02-09 07:01:52 -0800
commitf82baf0762f60c2ca5ffc339b095f9271d7c2f33 (patch)
tree4439a2ad3f6021a62be8bba8a8bf8da6d4b03174 /src/bench/block_assemble.cpp
parent9db10a55061e09021ff8ea1d6637d99f7959035f (diff)
[refactor] return MempoolAcceptResult
This creates a cleaner interface with ATMP, allows us to make results const, and makes accessing values that don't make sense (e.g. fee when tx is invalid) an error.
Diffstat (limited to 'src/bench/block_assemble.cpp')
-rw-r--r--src/bench/block_assemble.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/bench/block_assemble.cpp b/src/bench/block_assemble.cpp
index af5a82f69f..9f7d582e8a 100644
--- a/src/bench/block_assemble.cpp
+++ b/src/bench/block_assemble.cpp
@@ -48,9 +48,8 @@ static void AssembleBlock(benchmark::Bench& bench)
LOCK(::cs_main); // Required for ::AcceptToMemoryPool.
for (const auto& txr : txs) {
- TxValidationState state;
- bool ret{::AcceptToMemoryPool(*test_setup.m_node.mempool, state, txr, nullptr /* plTxnReplaced */, false /* bypass_limits */)};
- assert(ret);
+ const MempoolAcceptResult res = ::AcceptToMemoryPool(*test_setup.m_node.mempool, txr, false /* bypass_limits */);
+ assert(res.m_result_type == MempoolAcceptResult::ResultType::VALID);
}
}