mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-24 17:11:40 +02:00
Merge bitcoin/bitcoin#29954: RPC: Return permitbaremultisig
and maxdatacarriersize
in getmempoolinfo
1c10b7351e
RPC: Return permitbaremultisig and maxdatacarriersize in getmempoolinfo (Kristaps Kaupe) Pull request description: Other node relay settings like `fullrbf` and `minrelaytxfee` are already returned, makes sense to add these two too. ACKs for top commit: ajtowns: ACK1c10b7351e
maflcko: lgtm ACK1c10b7351e
theStack: ACK1c10b7351e
Tree-SHA512: 1750d7d12de511f0ac34922ea9c58c4b9b55c3aaf22109abfd7dbe01ad1eb7b48fb4a6b074a0baf0e55ee2270fcc969b6830e499ff33adbcd0b9c761fb25e563
This commit is contained in:
@@ -691,6 +691,8 @@ UniValue MempoolInfoToJSON(const CTxMemPool& pool)
|
||||
ret.pushKV("incrementalrelayfee", ValueFromAmount(pool.m_opts.incremental_relay_feerate.GetFeePerK()));
|
||||
ret.pushKV("unbroadcastcount", uint64_t{pool.GetUnbroadcastTxs().size()});
|
||||
ret.pushKV("fullrbf", true);
|
||||
ret.pushKV("permitbaremultisig", pool.m_opts.permit_bare_multisig);
|
||||
ret.pushKV("maxdatacarriersize", pool.m_opts.max_datacarrier_bytes.value_or(0));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -713,6 +715,8 @@ static RPCHelpMan getmempoolinfo()
|
||||
{RPCResult::Type::NUM, "incrementalrelayfee", "minimum fee rate increment for mempool limiting or replacement in " + CURRENCY_UNIT + "/kvB"},
|
||||
{RPCResult::Type::NUM, "unbroadcastcount", "Current number of transactions that haven't passed initial broadcast yet"},
|
||||
{RPCResult::Type::BOOL, "fullrbf", "True if the mempool accepts RBF without replaceability signaling inspection (DEPRECATED)"},
|
||||
{RPCResult::Type::BOOL, "permitbaremultisig", "True if the mempool accepts transactions with bare multisig outputs"},
|
||||
{RPCResult::Type::NUM, "maxdatacarriersize", "Maximum number of bytes that can be used by OP_RETURN outputs in the mempool"},
|
||||
}},
|
||||
RPCExamples{
|
||||
HelpExampleCli("getmempoolinfo", "")
|
||||
|
@@ -78,6 +78,8 @@ class MempoolAcceptanceTest(BitcoinTestFramework):
|
||||
node = self.nodes[0]
|
||||
self.wallet = MiniWallet(node)
|
||||
|
||||
assert_equal(node.getmempoolinfo()['permitbaremultisig'], False)
|
||||
|
||||
self.log.info('Start with empty mempool, and 200 blocks')
|
||||
self.mempool_size = 0
|
||||
assert_equal(node.getblockcount(), 200)
|
||||
|
@@ -13,7 +13,10 @@ from test_framework.script import (
|
||||
)
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.test_node import TestNode
|
||||
from test_framework.util import assert_raises_rpc_error
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
assert_raises_rpc_error,
|
||||
)
|
||||
from test_framework.wallet import MiniWallet
|
||||
|
||||
from random import randbytes
|
||||
@@ -48,6 +51,14 @@ class DataCarrierTest(BitcoinTestFramework):
|
||||
def run_test(self):
|
||||
self.wallet = MiniWallet(self.nodes[0])
|
||||
|
||||
# Test that bare multisig is allowed by default. Do it here rather than create a new test for it.
|
||||
assert_equal(self.nodes[0].getmempoolinfo()["permitbaremultisig"], True)
|
||||
|
||||
assert_equal(self.nodes[0].getmempoolinfo()["maxdatacarriersize"], MAX_OP_RETURN_RELAY)
|
||||
assert_equal(self.nodes[1].getmempoolinfo()["maxdatacarriersize"], 0)
|
||||
assert_equal(self.nodes[2].getmempoolinfo()["maxdatacarriersize"], CUSTOM_DATACARRIER_ARG)
|
||||
assert_equal(self.nodes[3].getmempoolinfo()["maxdatacarriersize"], 2)
|
||||
|
||||
# By default, any size is allowed.
|
||||
|
||||
# If it is custom set to 83, the historical value,
|
||||
|
Reference in New Issue
Block a user