Changeset View
Changeset View
Standalone View
Standalone View
src/test/util/setup_common.cpp
Show First 20 Lines • Show All 358 Lines • ▼ Show 20 Lines | CMutableTransaction TestChain100Setup::CreateValidMempoolTransaction( | ||||
SigHashType nHashType = SigHashType().withForkId(); | SigHashType nHashType = SigHashType().withForkId(); | ||||
std::map<int, std::string> input_errors; | std::map<int, std::string> input_errors; | ||||
assert(SignTransaction(mempool_txn, &keystore, input_coins, nHashType, | assert(SignTransaction(mempool_txn, &keystore, input_coins, nHashType, | ||||
input_errors)); | input_errors)); | ||||
// If submit=true, add transaction to the mempool. | // If submit=true, add transaction to the mempool. | ||||
if (submit) { | if (submit) { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
const MempoolAcceptResult result = AcceptToMemoryPool( | const MempoolAcceptResult result = m_node.chainman->ProcessTransaction( | ||||
m_node.chainman->ActiveChainstate(), GetConfig(), | MakeTransactionRef(mempool_txn)); | ||||
*m_node.mempool.get(), MakeTransactionRef(mempool_txn), | |||||
/* bypass_limits */ false); | |||||
assert(result.m_result_type == MempoolAcceptResult::ResultType::VALID); | assert(result.m_result_type == MempoolAcceptResult::ResultType::VALID); | ||||
} | } | ||||
return mempool_txn; | return mempool_txn; | ||||
} | } | ||||
TestChain100Setup::~TestChain100Setup() { | TestChain100Setup::~TestChain100Setup() { | ||||
if (m_deterministic) { | if (m_deterministic) { | ||||
▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines |