From 4b52e602422784d4c059cdc973f2a2e06930a9c0 Mon Sep 17 00:00:00 2001 From: f321x Date: Mon, 16 Jun 2025 17:08:45 +0200 Subject: [PATCH 1/2] fix: incorrect blockchain.relayfee description The description of `blockchain.relayfee` promises the user that transactions paying the relayfee will get accepted into the servers mempool. This however seems incorrect as the relayfee is just a fixed value in the core backend (either configured or a hardcoded default value) and doesn't change with a growing mempool. See definition: https://github.com/laanwj/bitcoin/blob/d387b8ec15e553db9b9c370314ee359e981fb374/src/main.cpp#L55-L56 and usage for the API: https://github.com/laanwj/bitcoin/blob/d387b8ec15e553db9b9c370314ee359e981fb374/src/rpcmisc.cpp#L86-L87 To get the minimal feerate to be paid for mempool acceptance one has to use getmempoolinfo['mempoolminfee']. --- docs/protocol-methods.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/protocol-methods.rst b/docs/protocol-methods.rst index 3d9d73b..8507398 100644 --- a/docs/protocol-methods.rst +++ b/docs/protocol-methods.rst @@ -237,8 +237,9 @@ Subscribe to receive block headers when a new block is found. blockchain.relayfee =================== -Return the minimum fee a low-priority transaction must pay in order to -be accepted to the daemon's memory pool. +Feerates lower than this are considered zero fee and are not being +relayed to the bitcoin network by the server. +This feerate does not guarantee acceptance into the mempool of the server. **Signature** From 5f108c946ba56e3fd22d9d0af86bc8b2ed7675fc Mon Sep 17 00:00:00 2001 From: f321x Date: Mon, 16 Jun 2025 17:21:43 +0200 Subject: [PATCH 2/2] add blockchain.mempoolminfee() method adds method blockchain.mempoolminfee() which is supposed to return the minimal feerate a transaction has to pay in order to get accepted to the servers mempool. --- docs/protocol-methods.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/protocol-methods.rst b/docs/protocol-methods.rst index 8507398..74cc6c2 100644 --- a/docs/protocol-methods.rst +++ b/docs/protocol-methods.rst @@ -260,6 +260,29 @@ This feerate does not guarantee acceptance into the mempool of the server. 0.0 +blockchain.mempoolminfee +======================== + +Minimum fee rate in BTC/kvB for a transaction to be accepted into the servers mempool. + +**Signature** + + .. function:: blockchain.mempoolminfee() + +**Result** + + The BTC/kvB fee in whole coin units (BTC, not satoshis) as a floating point number. + +**Example Results** + +:: + + 0.00002123 + +:: + + 0.00001000 + blockchain.scripthash.get_balance =================================