mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-05-17 23:56:39 +00:00
[rpc] allow submitpackage to be called outside of regtest
This commit is contained in:
parent
5b9087a9a7
commit
7a9bb2a2a5
@ -819,12 +819,11 @@ static RPCHelpMan savemempool()
|
|||||||
static RPCHelpMan submitpackage()
|
static RPCHelpMan submitpackage()
|
||||||
{
|
{
|
||||||
return 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 must consist of a child with its parents, and none of the parents may depend on one another.\n"
|
"The package must consist of a child with its parents, and none of the parents may depend on one another.\n"
|
||||||
"The package will be validated according to consensus and mempool policy rules. If all transactions pass, they will be accepted to mempool.\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"
|
"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"
|
"Warning: successful submission does not mean the transactions will propagate throughout the network.\n"
|
||||||
"Currently, each transaction is broadcasted individually after submission, which means they must meet other nodes' feerate requirements alone.\n"
|
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
{"package", RPCArg::Type::ARR, RPCArg::Optional::NO, "An array of raw transactions.",
|
{"package", RPCArg::Type::ARR, RPCArg::Optional::NO, "An array of raw transactions.",
|
||||||
@ -863,9 +862,6 @@ static RPCHelpMan submitpackage()
|
|||||||
},
|
},
|
||||||
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
||||||
{
|
{
|
||||||
if (Params().GetChainType() != ChainType::REGTEST) {
|
|
||||||
throw std::runtime_error("submitpackage is for regression testing (-regtest mode) only");
|
|
||||||
}
|
|
||||||
const UniValue raw_transactions = request.params[0].get_array();
|
const UniValue raw_transactions = request.params[0].get_array();
|
||||||
if (raw_transactions.size() < 1 || raw_transactions.size() > MAX_PACKAGE_COUNT) {
|
if (raw_transactions.size() < 1 || raw_transactions.size() > MAX_PACKAGE_COUNT) {
|
||||||
throw JSONRPCError(RPC_INVALID_PARAMETER,
|
throw JSONRPCError(RPC_INVALID_PARAMETER,
|
||||||
@ -987,7 +983,7 @@ void RegisterMempoolRPCCommands(CRPCTable& t)
|
|||||||
{"blockchain", &getrawmempool},
|
{"blockchain", &getrawmempool},
|
||||||
{"blockchain", &importmempool},
|
{"blockchain", &importmempool},
|
||||||
{"blockchain", &savemempool},
|
{"blockchain", &savemempool},
|
||||||
{"hidden", &submitpackage},
|
{"rawtransactions", &submitpackage},
|
||||||
};
|
};
|
||||||
for (const auto& c : commands) {
|
for (const auto& c : commands) {
|
||||||
t.appendCommand(c.name, &c);
|
t.appendCommand(c.name, &c);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user