Skip to content

Commit

Permalink
[rpc] allow submitpackage to be called outside of regtest
Browse files Browse the repository at this point in the history
  • Loading branch information
glozow committed Apr 19, 2023
1 parent efa53b7 commit d682a10
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/rpc/mempool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,11 +759,10 @@ static RPCHelpMan savemempool()
static RPCHelpMan submitpackage()
{
return RPCHelpMan{"submitpackage",
"Submit a package of raw transactions (serialized, hex-encoded) to local node (-regtest only).\n"
"Submit a package of raw transactions (serialized, hex-encoded) to local node.\n"
"The package will be validated according to consensus and mempool policy rules. If all transactions pass, they will be accepted to mempool.\n"
"This RPC is experimental and the interface may be unstable. Refer to doc/policy/packages.md for documentation on package policies.\n"
"Warning: until package relay is in use, successful submission does not mean the transaction will propagate to other nodes on the network.\n"
"Currently, each transaction is broadcasted individually after submission, which means they must meet other nodes' feerate requirements alone.\n"
"Warning: unless this node and others are using package relay (-packagerelay), successful submission does not mean the transactions will propagate throughout the network.\n"
,
{
{"package", RPCArg::Type::ARR, RPCArg::Optional::NO, "An array of raw transactions.",
Expand Down Expand Up @@ -802,9 +801,6 @@ static RPCHelpMan submitpackage()
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
if (!Params().IsMockableChain()) {
throw std::runtime_error("submitpackage is for regression testing (-regtest mode) only");
}
const UniValue raw_transactions = request.params[0].get_array();
if (raw_transactions.size() < 1 || raw_transactions.size() > MAX_PACKAGE_COUNT) {
throw JSONRPCError(RPC_INVALID_PARAMETER,
Expand Down Expand Up @@ -922,7 +918,7 @@ void RegisterMempoolRPCCommands(CRPCTable& t)
{"blockchain", &getmempoolinfo},
{"blockchain", &getrawmempool},
{"blockchain", &savemempool},
{"hidden", &submitpackage},
{"rawtransactions", &submitpackage},
};
for (const auto& c : commands) {
t.appendCommand(c.name, &c);
Expand Down

0 comments on commit d682a10

Please sign in to comment.