Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getrawmempool rpc response is incompatible with bitcoin core response #2310

Open
lnliz opened this issue Jan 29, 2025 · 1 comment
Open

getrawmempool rpc response is incompatible with bitcoin core response #2310

lnliz opened this issue Jan 29, 2025 · 1 comment

Comments

@lnliz
Copy link

lnliz commented Jan 29, 2025

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:

type GetRawMempoolVerboseResult struct {
Size int32 `json:"size"`
Vsize int32 `json:"vsize"`
Weight int32 `json:"weight"`
Fee float64 `json:"fee"`
Time int64 `json:"time"`
Height int64 `json:"height"`
StartingPriority float64 `json:"startingpriority"`
CurrentPriority float64 `json:"currentpriority"`
Depends []string `json:"depends"`
}

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

Image
@Roasbeef
Copy link
Member

Roasbeef commented Feb 7, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@Roasbeef @lnliz and others