9#include <chainparams.h>
23#include <validation.h>
37 "Submits raw transaction (serialized, hex-encoded) to local node and "
39 "\nAlso see createrawtransaction and "
40 "signrawtransactionwithkey calls.\n",
43 "The hex string of the raw transaction"},
47 "Reject transactions whose fee rate is higher than the specified "
48 "value, expressed in " +
50 "/kB\nSet to 0 to accept any fee rate.\n"},
54 "\nCreate a transaction\n" +
56 "createrawtransaction",
57 "\"[{\\\"txid\\\" : \\\"mytxid\\\",\\\"vout\\\":0}]\" "
58 "\"{\\\"myaddress\\\":10000}\"") +
59 "Sign the transaction, and get back the hex\n" +
61 "\nSend the transaction (signed hex)\n" +
63 "\nAs a JSON-RPC call\n" +
69 if (!
DecodeHexTx(mtx, request.params[0].get_str())) {
77 request.params[1].isNull()
82 Amount max_raw_tx_fee = max_raw_tx_fee_rate.
GetFee(virtual_size);
84 std::string err_string;
88 node, tx, err_string, max_raw_tx_fee,
true,
90 if (err != TransactionError::OK) {
96 ->SyncWithValidationInterfaceQueue();
98 return tx->GetHash().GetHex();
107 "\nReturns result of mempool acceptance tests indicating if raw "
108 "transaction(s) (serialized, hex-encoded) would be accepted by "
110 "\nIf multiple transactions are passed in, parents must come before "
111 "children and package policies apply: the transactions cannot conflict "
112 "with any mempool transactions or each other.\n"
113 "\nIf one transaction fails, other transactions may not be fully "
114 "validated (the 'allowed' key will be blank).\n"
115 "\nThe maximum number of transactions allowed is " +
118 "\nThis checks if transactions violate the consensus or policy "
120 "\nSee sendrawtransaction call.\n",
126 "An array of hex strings of raw transactions.",
135 "Reject transactions whose fee rate is higher than the specified "
136 "value, expressed in " +
142 "The result of the mempool acceptance test for each raw "
143 "transaction in the input array.\n"
144 "Returns results for each transaction in the same order they were "
146 "Transactions that cannot be fully validated due to failures in "
147 "other transactions will not contain an 'allowed' result.\n",
154 "The transaction hash in hex"},
156 "Package validation error, if any (only possible if "
157 "rawtxs had more than 1 transaction)."},
159 "Whether this tx would be accepted to the mempool and "
160 "pass client-specified maxfeerate. "
161 "If not present, the tx was not fully validated due to a "
162 "failure in another tx in the list."},
166 "Transaction fees (only present if 'allowed' is true)",
169 "transaction fee in " + ticker},
171 "the effective feerate in " + ticker +
172 " per KvB. May differ from the base feerate if, "
173 "for example, there are modified fees from "
174 "prioritisetransaction or a package feerate was "
177 "effective-includes",
178 "transactions whose fees and vsizes are included in "
179 "effective-feerate.",
182 "transaction txid in hex"},
186 "Rejection string (only present when 'allowed' is "
189 "Rejection details (only present when 'allowed' is false "
190 "and rejection details exist)"},
195 "\nCreate a transaction\n" +
197 "createrawtransaction",
198 "\"[{\\\"txid\\\" : \\\"mytxid\\\",\\\"vout\\\":0}]\" "
199 "\"{\\\"myaddress\\\":10000}\"") +
200 "Sign the transaction, and get back the hex\n" +
202 "\nTest acceptance of the transaction (signed hex)\n" +
204 "\nAs a JSON-RPC call\n" +
209 if (raw_transactions.
size() < 1 ||
212 "Array must contain between 1 and " +
217 const CFeeRate max_raw_tx_fee_rate =
218 request.params[1].isNull()
222 std::vector<CTransactionRef> txns;
223 txns.reserve(raw_transactions.
size());
224 for (
const auto &rawtx : raw_transactions.
getValues()) {
228 "TX decode failed: " + rawtx.get_str());
239 if (txns.size() > 1) {
255 bool exit_early{
false};
256 for (
const auto &tx : txns) {
258 result_inner.
pushKV(
"txid", tx->GetId().GetHex());
265 auto it = package_result.
m_tx_results.find(tx->GetId());
266 if (exit_early || it == package_result.
m_tx_results.end()) {
268 rpc_result.
push_back(std::move(result_inner));
271 const auto &tx_result = it->second;
276 if (tx_result.m_result_type ==
278 const Amount fee = tx_result.m_base_fees.value();
280 const int64_t virtual_size = tx_result.m_vsize.value();
281 const Amount max_raw_tx_fee =
282 max_raw_tx_fee_rate.
GetFee(virtual_size);
284 fee > max_raw_tx_fee) {
285 result_inner.
pushKV(
"allowed",
false);
286 result_inner.
pushKV(
"reject-reason",
293 result_inner.
pushKV(
"allowed",
true);
294 result_inner.
pushKV(
"size", virtual_size);
299 tx_result.m_effective_feerate.value().GetFeePerK());
301 for (
const auto &txid :
302 tx_result.m_txids_fee_calculations.value()) {
303 effective_includes_res.
push_back(txid.ToString());
305 fees.
pushKV(
"effective-includes",
306 std::move(effective_includes_res));
307 result_inner.
pushKV(
"fees", std::move(fees));
310 result_inner.
pushKV(
"allowed",
false);
314 result_inner.
pushKV(
"reject-reason",
"missing-inputs");
316 result_inner.
pushKV(
"reject-reason",
321 rpc_result.
push_back(std::move(result_inner));
333 "local time transaction entered pool in seconds since 1 Jan "
336 "block height when transaction entered pool"},
342 "transaction fee in " + ticker},
344 "transaction fee with fee deltas used for "
345 "mining priority in " +
351 "unconfirmed transactions used as inputs for this transaction",
353 "parent transaction id"}}},
357 "unconfirmed transactions spending outputs from this transaction",
359 "child transaction id"}}},
361 "Whether this transaction is currently unbroadcast (initial "
362 "broadcast not yet acknowledged by any peers)"},
372 fees.
pushKV(
"base", e->GetFee());
373 fees.
pushKV(
"modified", e->GetModifiedFee());
374 info.pushKV(
"fees", fees);
376 info.pushKV(
"size", (
int)e->GetTxSize());
378 info.pushKV(
"height", (
int)e->GetHeight());
379 const CTransaction &tx = e->GetTx();
380 std::set<std::string> setDepends;
381 for (
const CTxIn &txin : tx.vin) {
382 if (pool.exists(txin.prevout.GetTxId())) {
383 setDepends.insert(txin.prevout.GetTxId().ToString());
388 for (
const std::string &dep : setDepends) {
392 info.pushKV(
"depends", std::move(depends));
395 for (
const auto &child : e->GetMemPoolChildrenConst()) {
396 spent.
push_back(child.get()->GetTx().GetId().ToString());
399 info.pushKV(
"spentby", std::move(spent));
400 info.pushKV(
"unbroadcast", pool.IsUnbroadcastTx(tx.GetId()));
404 bool include_mempool_sequence) {
406 if (include_mempool_sequence) {
409 "Verbose results cannot contain mempool sequence values.");
414 const TxId &txid = e->GetTx().GetId();
424 uint64_t mempool_sequence;
425 std::vector<TxId> vtxids;
432 for (
const TxId &txid : vtxids) {
436 if (!include_mempool_sequence) {
440 o.
pushKV(
"txids", std::move(a));
441 o.
pushKV(
"mempool_sequence", mempool_sequence);
450 "Returns all transaction ids in memory pool as a json array of "
451 "string transaction ids.\n"
452 "\nHint: use getmempoolentry to fetch a specific transaction from the "
456 "True for a json object, false for array of transaction ids"},
458 "If verbose=false, returns a json object with transaction list "
459 "and mempool sequence number attached."},
478 "for verbose = false and mempool_sequence = true",
490 "The mempool sequence value."},
497 bool fVerbose =
false;
498 if (!request.params[0].isNull()) {
499 fVerbose = request.params[0].
get_bool();
502 bool include_mempool_sequence =
false;
503 if (!request.params[1].isNull()) {
504 include_mempool_sequence = request.params[1].get_bool();
508 include_mempool_sequence);
515 "getmempoolancestors",
516 "If txid is in the mempool, returns all in-mempool ancestors.\n",
519 "The transaction id (must be in mempool)"},
521 "True for a json object, false for array of transaction ids"},
525 "for verbose = false",
530 "The transaction id of an in-mempool ancestor transaction"}}},
544 bool fVerbose =
false;
545 if (!request.params[1].isNull()) {
546 fVerbose = request.params[1].
get_bool();
555 if (it == mempool.mapTx.end()) {
557 "Transaction not in mempool");
566 o.
push_back((*ancestorIt)->GetTx().GetId().ToString());
573 const TxId &_txid = e->GetTx().GetId();
586 "getmempooldescendants",
587 "If txid is in the mempool, returns all in-mempool descendants.\n",
590 "The transaction id (must be in mempool)"},
592 "True for a json object, false for array of transaction ids"},
600 "The transaction id of an in-mempool descendant "
615 bool fVerbose =
false;
616 if (!request.params[1].isNull()) {
617 fVerbose = request.params[1].
get_bool();
626 if (it == mempool.mapTx.end()) {
628 "Transaction not in mempool");
634 setDescendants.erase(it);
639 o.
push_back((*descendantIt)->GetTx().GetId().ToString());
647 const TxId &_txid = e->GetTx().GetId();
661 "Returns mempool data for given transaction\n",
664 "The transaction id (must be in mempool)"},
677 if (it == mempool.mapTx.end()) {
679 "Transaction not in mempool");
698 ret.
pushKV(
"finalized_txs_sigchecks",
715 "Returns details on the active state of the TX memory pool.\n",
723 "True if the initial load attempt of the persisted mempool "
728 "Current finalized tx count"},
730 "Sum of all finalized transaction sizes"},
732 "Sum of all finalized transaction sigchecks"},
734 "Total memory usage for the mempool"},
736 "Maximum memory usage for the mempool"},
738 "Total fees for the mempool in " + ticker +
739 ", ignoring modified fees through prioritizetransaction"},
741 "Minimum fee rate in " + ticker +
742 "/kB for tx to be accepted. Is the maximum of "
743 "minrelaytxfee and minimum mempool fee"},
745 "Current minimum relay fee for transactions"},
747 "Current number of transactions that haven't passed initial "
762 "Import a mempool.dat file and attempt to add its contents to the "
764 "Warning: Importing untrusted files is dangerous, especially if "
765 "metadata from the file is taken over.",
775 "Whether to use the current system time or use the entry "
776 "time metadata from the mempool file.\n"
777 "Warning: Importing untrusted metadata may lead to "
778 "unexpected issues and undesirable behavior."},
781 "Whether to apply the fee delta metadata from the mempool "
783 "It will be added to any existing fee deltas.\n"
784 "The fee delta can be set by the prioritisetransaction RPC.\n"
785 "Warning: Importing untrusted metadata may lead to "
786 "unexpected issues and undesirable behavior.\n"
787 "Only set this bool if you understand what it does."},
790 "Whether to apply the unbroadcast set metadata from the "
792 "Warning: Importing untrusted metadata may lead to "
793 "unexpected issues and undesirable behavior."},
810 "Can only import the mempool after the "
811 "block download and sync is done.");
816 request.params[1][
"use_current_time"]};
818 request.params[1][
"apply_fee_delta_priority"]};
820 request.params[1][
"apply_unbroadcast_set"]};
824 : use_current_time.get_bool(),
825 .apply_fee_delta_priority = apply_fee_delta.isNull()
827 : apply_fee_delta.get_bool(),
828 .apply_unbroadcast_set = apply_unbroadcast.isNull()
830 : apply_unbroadcast.get_bool(),
836 "Unable to import mempool file, see "
837 "debug.log for details.");
849 "Dumps the mempool to disk. It will fail until the previous dump is "
857 "the directory and file where the mempool was saved"},
868 "The mempool was not loaded yet");
875 "Unable to dump mempool to disk");
890 "Submit a package of raw transactions (serialized, hex-encoded) to "
892 "The package must consist of a child with its parents, and none of the "
893 "parents may depend on one another.\n"
894 "The package will be validated according to consensus and mempool "
895 "policy rules. If any transaction passes, it will be accepted to "
897 "This RPC is experimental and the interface may be unstable. Refer to "
898 "doc/policy/packages.md for documentation on package policies.\n"
899 "Warning: successful submission does not mean the transactions will "
900 "propagate throughout the network.\n",
906 "An array of raw transactions.",
919 "The transaction package result message. \"success\" "
920 "indicates all transactions were accepted into or are already "
924 "transaction results keyed by txid",
930 "Virtual transaction size."},
937 "transaction fee in " + ticker},
939 "the effective feerate in " + ticker +
940 " per KvB. May differ from the base feerate "
941 "if, for example, there are modified fees "
942 "from prioritisetransaction or a package "
943 "feerate was used."},
945 "effective-includes",
946 "transactions whose fees and vsizes are included "
947 "in effective-feerate.",
950 "transaction txid in hex"},
954 "The transaction error string, if it was rejected by "
964 if (raw_transactions.
size() < 1 ||
967 "Array must contain between 1 and " +
972 std::vector<CTransactionRef> txns;
973 txns.reserve(raw_transactions.
size());
974 for (
const auto &rawtx : raw_transactions.
getValues()) {
979 "TX decode failed: " + rawtx.get_str() +
980 " Make sure the tx has at least one input.");
986 TransactionError::INVALID_PACKAGE,
987 "package topology disallowed. not child-with-parents or "
988 "parents depend on each other.");
998 std::string package_msg =
"success";
1001 switch (package_result.m_state.GetResult()) {
1007 for (
const auto &tx : txns) {
1016 TransactionError::MEMPOOL_ERROR,
1017 package_result.m_state.GetRejectReason());
1023 package_msg = package_result.m_state.GetRejectReason();
1026 package_result.m_tx_results.empty());
1030 size_t num_broadcast{0};
1031 for (
const auto &tx : txns) {
1034 if (!mempool.
exists(tx->GetId())) {
1040 std::string err_string;
1044 if (err != TransactionError::OK) {
1047 strprintf(
"transaction broadcast failed: %s (%d "
1048 "transactions were broadcast successfully)",
1049 err_string, num_broadcast));
1055 rpc_result.pushKV(
"package_msg", package_msg);
1057 for (
const auto &tx : txns) {
1059 auto it = package_result.m_tx_results.find(tx->GetId());
1060 if (it == package_result.m_tx_results.end()) {
1062 result_inner.pushKV(
"error",
"unevaluated");
1065 const auto &tx_result = it->second;
1066 switch (it->second.m_result_type) {
1068 result_inner.pushKV(
"error",
1069 it->second.m_state.ToString());
1073 result_inner.pushKV(
1074 "vsize", int64_t{it->second.m_vsize.value()});
1076 fees.
pushKV(
"base", it->second.m_base_fees.value());
1077 if (tx_result.m_result_type ==
1084 fees.
pushKV(
"effective-feerate",
1085 tx_result.m_effective_feerate.value()
1088 for (
const auto &txid :
1089 tx_result.m_txids_fee_calculations.value()) {
1093 fees.
pushKV(
"effective-includes",
1094 std::move(effective_includes_res));
1096 result_inner.pushKV(
"fees", std::move(fees));
1099 tx_result_map.pushKV(tx->GetId().GetHex(),
1100 std::move(result_inner));
1102 rpc_result.pushKV(
"tx-results", std::move(tx_result_map));
1124 for (
const auto &c : commands) {
#define CHECK_NONFATAL(condition)
Identity function.
Fee rate in satoshis per kilobyte: Amount / kB.
Amount GetFeePerK() const
Return the fee in satoshis for a size of 1000 bytes.
Amount GetFee(size_t nBytes) const
Return the fee in satoshis for the given size in bytes.
A mutable version of CTransaction.
void appendCommand(const std::string &name, const CRPCCommand *pcmd)
Appends a CRPCCommand to the dispatch table.
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
std::set< txiter, CompareIteratorById > setEntries
bool GetLoadTried() const
CFeeRate GetMinFee() const
The minimum fee to get into the mempool, which may itself not be enough for larger-sized transactions...
RecursiveMutex cs
This mutex needs to be locked when accessing mapTx or other members that are guarded by it.
Amount GetTotalFee() const EXCLUSIVE_LOCKS_REQUIRED(cs)
uint64_t GetTotalFinalizedTxSigchecks() const EXCLUSIVE_LOCKS_REQUIRED(cs)
void getAllTxIds(std::vector< TxId > &vtxid) const
size_t DynamicMemoryUsage() const
bool exists(const TxId &txid) const
std::set< TxId > GetUnbroadcastTxs() const
Returns transactions in unbroadcast set.
uint64_t GetSequence() const EXCLUSIVE_LOCKS_REQUIRED(cs)
indexed_transaction_set::nth_index< 0 >::type::const_iterator txiter
uint64_t GetFinalizedTxCount() const EXCLUSIVE_LOCKS_REQUIRED(cs)
bool CalculateMemPoolAncestors(const CTxMemPoolEntryRef &entry, setEntries &setAncestors, bool fSearchForParents=true) const EXCLUSIVE_LOCKS_REQUIRED(cs)
Try to calculate all in-mempool ancestors of entry.
uint64_t GetTotalFinalizedTxSize() const EXCLUSIVE_LOCKS_REQUIRED(cs)
void CalculateDescendants(txiter it, setEntries &setDescendants) const EXCLUSIVE_LOCKS_REQUIRED(cs)
Populate setDescendants with all in-mempool descendants of hash.
unsigned long size() const
uint64_t GetTotalTxSize() const EXCLUSIVE_LOCKS_REQUIRED(cs)
Chainstate stores and provides an API to update our local knowledge of the current best chain.
Provides an interface for creating and interacting with one or two chainstates: an IBD chainstate gen...
SnapshotCompletionResult MaybeCompleteSnapshotValidation() EXCLUSIVE_LOCKS_REQUIRED(const CBlockIndex *GetSnapshotBaseBlock() const EXCLUSIVE_LOCKS_REQUIRED(Chainstate ActiveChainstate)() const
Once the background validation chainstate has reached the height which is the base of the UTXO snapsh...
MempoolAcceptResult ProcessTransaction(const CTransactionRef &tx, bool test_accept=false) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Try to add a transaction to the memory pool.
bool IsInitialBlockDownload() const
Check whether we are doing an initial block download (synchronizing from disk or network)
void push_back(UniValue val)
const std::vector< UniValue > & getValues() const
void pushKVEnd(std::string key, UniValue val)
const UniValue & get_array() const
void pushKV(std::string key, UniValue val)
std::string GetRejectReason() const
std::string ToString() const
std::string ToString() const
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
std::string u8string() const
@ TX_MISSING_INPUTS
transaction was missing some of its inputs
bool DecodeHexTx(CMutableTransaction &tx, const std::string &strHexTx)
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
static RPCHelpMan getmempoolinfo()
static RPCHelpMan sendrawtransaction()
static RPCHelpMan importmempool()
void RegisterMempoolRPCCommands(CRPCTable &t)
Register mempool RPC commands.
static RPCHelpMan getrawmempool()
static RPCHelpMan getmempoolentry()
UniValue MempoolInfoToJSON(const CTxMemPool &pool)
Mempool information to JSON.
static std::vector< RPCResult > MempoolEntryDescription()
static RPCHelpMan submitpackage()
UniValue MempoolToJSON(const CTxMemPool &pool, bool verbose, bool include_mempool_sequence)
Mempool to JSON.
static void entryToJSON(const CTxMemPool &pool, UniValue &info, const CTxMemPoolEntryRef &e) EXCLUSIVE_LOCKS_REQUIRED(pool.cs)
static RPCHelpMan testmempoolaccept()
static RPCHelpMan getmempooldescendants()
static RPCHelpMan getmempoolancestors()
static RPCHelpMan savemempool()
std::string FormatMoney(const Amount amt)
Do not use these functions to represent or parse monetary amounts to or from JSON but use AmountFromV...
static path u8path(const std::string &utf8_str)
bool LoadMempool(CTxMemPool &pool, const fs::path &load_path, Chainstate &active_chainstate, ImportMempoolOptions &&opts)
Import the file and attempt to add its contents to the mempool.
bool DumpMempool(const CTxMemPool &pool, const fs::path &dump_path, FopenFn mockable_fopen_function, bool skip_file_commit)
TransactionError BroadcastTransaction(const NodeContext &node, const CTransactionRef tx, std::string &err_string, const Amount max_tx_fee, bool relay, bool wait_callback)
Submit a transaction to the mempool and (optionally) relay it to all P2P peers.
fs::path MempoolPath(const ArgsManager &argsman)
static const CFeeRate DEFAULT_MAX_RAW_TX_FEE_RATE
Maximum fee rate for sendrawtransaction and testmempoolaccept RPC calls.
std::string ToString(const T &t)
Locale-independent version of std::to_string.
is a home for public enum and struct type definitions that are used by internally by node code,...
bool IsChildWithParentsTree(const Package &package)
Context-free check that a package IsChildWithParents() and none of the parents depend on each other (...
static constexpr uint32_t MAX_PACKAGE_COUNT
Default maximum number of transactions in a package.
@ PCKG_POLICY
The package itself is invalid (e.g. too many transactions).
@ PCKG_RESULT_UNSET
Initial value. The package has not yet been rejected.
@ PCKG_MEMPOOL_ERROR
Mempool logic error.
@ PCKG_TX
At least one tx is invalid.
int64_t GetVirtualTransactionSize(int64_t nSize, int64_t nSigChecks, unsigned int bytes_per_sigCheck)
Compute the virtual transaction size (size, or more if sigChecks are too dense).
static CTransactionRef MakeTransactionRef()
std::shared_ptr< const CTransaction > CTransactionRef
UniValue JSONRPCError(int code, const std::string &message)
@ RPC_MISC_ERROR
General application defined errors std::exception thrown in command handling.
@ RPC_INVALID_PARAMETER
Invalid, missing or duplicate parameter.
@ RPC_CLIENT_IN_INITIAL_DOWNLOAD
Still downloading initial blocks.
@ RPC_DESERIALIZATION_ERROR
Error parsing or validating structure in raw format.
@ RPC_INVALID_ADDRESS_OR_KEY
Invalid address or key.
std::string HelpExampleCli(const std::string &methodname, const std::string &args)
UniValue JSONRPCTransactionError(TransactionError terr, const std::string &err_string)
Amount AmountFromValue(const UniValue &value)
std::string HelpExampleRpc(const std::string &methodname, const std::string &args)
uint256 ParseHashV(const UniValue &v, std::string strName)
Utilities: convert hex-encoded values (throws error if not hex).
static std::string ToString(const CService &ip)
NodeContext & EnsureAnyNodeContext(const std::any &context)
CTxMemPool & EnsureMemPool(const NodeContext &node)
ChainstateManager & EnsureChainman(const NodeContext &node)
CTxMemPool & EnsureAnyMemPool(const std::any &context)
ArgsManager & EnsureAnyArgsman(const std::any &context)
static constexpr Amount zero() noexcept
static std::string getTicker()
@ MEMPOOL_ENTRY
Valid, transaction was already in the mempool.
@ VALID
Fully validated, valid.
Validation result for package mempool acceptance.
PackageValidationState m_state
std::map< TxId, MempoolAcceptResult > m_tx_results
Map from txid to finished MempoolAcceptResults.
@ STR_HEX
Special type that is a STR with only hex chars.
@ AMOUNT
Special type representing a floating point amount (can be either NUM or STR)
@ OBJ_NAMED_PARAMS
Special type that behaves almost exactly like OBJ, defining an options object with a list of pre-defi...
@ OMITTED
Optional argument for which the default value is omitted from help text for one of two reasons:
std::string oneline_description
Should be empty unless it is supposed to override the auto-generated summary line.
@ NUM_TIME
Special numeric to denote unix epoch time.
@ OBJ_DYN
Special dictionary with keys that are not literals.
@ STR_HEX
Special string with only hex chars.
@ STR_AMOUNT
Special string to represent a floating point amount.
A TxId is the identifier of a transaction.
CFeeRate min_relay_feerate
A fee rate smaller than this is considered zero fee (for relaying, mining and transaction creation)
NodeContext struct containing references to chain state and connection state.
#define AssertLockNotHeld(cs)
#define WITH_LOCK(cs, code)
Run code while locking a mutex.
#define EXCLUSIVE_LOCKS_REQUIRED(...)
constexpr int64_t count_seconds(std::chrono::seconds t)
PackageMempoolAcceptResult ProcessNewPackage(Chainstate &active_chainstate, CTxMemPool &pool, const Package &package, bool test_accept)
Validate (and maybe submit) a package to the mempool.