Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/rawtransaction.cpp
Show First 20 Lines • Show All 1,162 Lines • ▼ Show 20 Lines | return RPCHelpMan{ | ||||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, | throw JSONRPCError(RPC_DESERIALIZATION_ERROR, | ||||
"TX decode failed: " + rawtx.get_str()); | "TX decode failed: " + rawtx.get_str()); | ||||
} | } | ||||
txns.emplace_back(MakeTransactionRef(std::move(mtx))); | txns.emplace_back(MakeTransactionRef(std::move(mtx))); | ||||
} | } | ||||
NodeContext &node = EnsureAnyNodeContext(request.context); | NodeContext &node = EnsureAnyNodeContext(request.context); | ||||
CTxMemPool &mempool = EnsureMemPool(node); | CTxMemPool &mempool = EnsureMemPool(node); | ||||
CChainState &chainstate = EnsureChainman(node).ActiveChainstate(); | ChainstateManager &chainman = EnsureChainman(node); | ||||
CChainState &chainstate = chainman.ActiveChainstate(); | |||||
const PackageMempoolAcceptResult package_result = [&] { | const PackageMempoolAcceptResult package_result = [&] { | ||||
LOCK(::cs_main); | LOCK(::cs_main); | ||||
if (txns.size() > 1) { | if (txns.size() > 1) { | ||||
return ProcessNewPackage(config, chainstate, mempool, txns, | return ProcessNewPackage(config, chainstate, mempool, txns, | ||||
/* test_accept */ true); | /* test_accept */ true); | ||||
} | } | ||||
return PackageMempoolAcceptResult( | return PackageMempoolAcceptResult( | ||||
txns[0]->GetId(), | txns[0]->GetId(), | ||||
AcceptToMemoryPool(chainstate, config, mempool, txns[0], | chainman.ProcessTransaction(txns[0], | ||||
/* bypass_limits */ false, | |||||
/* test_accept*/ true)); | /* test_accept*/ true)); | ||||
}(); | }(); | ||||
UniValue rpc_result(UniValue::VARR); | UniValue rpc_result(UniValue::VARR); | ||||
// We will check transaction fees while we iterate through txns in | // We will check transaction fees while we iterate through txns in | ||||
// order. If any transaction fee exceeds maxfeerate, we will leave | // order. If any transaction fee exceeds maxfeerate, we will leave | ||||
// the rest of the validation results blank, because it doesn't make | // the rest of the validation results blank, because it doesn't make | ||||
// sense to return a validation result for a transaction if its | // sense to return a validation result for a transaction if its | ||||
// ancestor(s) would not be submitted. | // ancestor(s) would not be submitted. | ||||
▲ Show 20 Lines • Show All 1,104 Lines • Show Last 20 Lines |