btcd icon indicating copy to clipboard operation
btcd copied to clipboard

getrawmempool rpc response is incompatible with bitcoin core response

Open lnliz opened this issue 11 months ago • 1 comments

getrawmempool rpc response is missing multiple fields like fees that make it impossible to use the rpc client with a vanilla bitcoin core node. fees were added in bitcoin 0.17.0 almost 7 years ago: https://bitcoincore.org/en/releases/0.17.0/

i can look into creating a PR to make this parity but wanted to ask first if it's desired.

current response struct: https://github.com/btcsuite/btcd/blob/09ba026580f4041bae30d732f26fa1a2036af003/btcjson/chainsvrresults.go#L468-L478

bitcoin core: https://bitcoincore.org/en/doc/28.0.0/rpc/blockchain/getrawmempool/

Image

lnliz avatar Jan 29 '25 15:01 lnliz

FWIW, there really isn't any sort of JSON-RPC standard that exists amongst Bitcoin nodes (no BIP, etc). Long ago, we decided to no longer follow all the induvidual changes that bitcoind was making to its JSON-RPC interface.

I don't see anything incompatible w.r.t what you've posted above, instead some fields may be missing. If you need those fields, you can make a new struct, then use RawRequest method to dispatch the RPC call.

Roasbeef avatar Feb 07 '25 00:02 Roasbeef