MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / CreateValidMempoolTransaction

Method CreateValidMempoolTransaction

src/test/util/setup_common.cpp:541–556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539}
540
541CMutableTransaction TestChain100Setup::CreateValidMempoolTransaction(const std::vector<CTransactionRef>& input_transactions,
542 const std::vector<COutPoint>& inputs,
543 int input_height,
544 const std::vector<CKey>& input_signing_keys,
545 const std::vector<CTxOut>& outputs,
546 bool submit)
547{
548 CMutableTransaction mempool_txn = CreateValidTransaction(input_transactions, inputs, input_height, input_signing_keys, outputs, std::nullopt, std::nullopt).first;
549 // If submit=true, add transaction to the mempool.
550 if (submit) {
551 LOCK(cs_main);
552 const MempoolAcceptResult result = m_node.chainman->ProcessTransaction(MakeTransactionRef(mempool_txn));
553 assert(result.m_result_type == MempoolAcceptResult::ResultType::VALID);
554 }
555 return mempool_txn;
556}
557
558CMutableTransaction TestChain100Setup::CreateValidMempoolTransaction(CTransactionRef input_transaction,
559 uint32_t input_vout,

Callers

nothing calls this directly

Calls 3

MakeTransactionRefFunction · 0.85
ProcessTransactionMethod · 0.80
GetHashMethod · 0.45

Tested by

no test coverage detected