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

Add CPFP endpoint #508

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add CPFP endpoint #508

wants to merge 2 commits into from

Conversation

dabura667
Copy link

Dependent on PR bitpay/bitcoind-rpc#24

Also, not sure whether it makes a difference with bitcore's bindings performance wise, but also related: bitcoin/bitcoin#10300

Feature: Adds access to an endpoint that will let the user know how much additional fee to add to their transaction to ensure that unconfirmed parent transactions are confirmed along with it at the same fee rate.

This can be utilized by bitcore-wallet-service when deciding a fee if a user specifies to use CPFP.

@dabura667
Copy link
Author

Note: Starting with bitcoin core 0.13.0, a new RPC call was added called getmempoolentry

If bitcore would support >=0.13.0 bitcoin Core, then we could add support for that to bitcoind-rpc repo make this better.

bitcoin-cli getmempoolentry ebf88e8aede968e8bd70e91f2e9400523157b42af06a96a207bfeb1b18866495
{
  "size": 225,
  "fee": 0.00027120,
  "modifiedfee": 0.00027120,
  "time": 1493777210,
  "height": 464590,
  "startingpriority": 0,
  "currentpriority": 0,
  "descendantcount": 1,
  "descendantsize": 225,
  "descendantfees": 27120,
  "ancestorcount": 4,
  "ancestorsize": 902,
  "ancestorfees": 108480,
  "depends": [
    "ee466a87cd2447cd0564a1f703a145e376ab32cffd6562e19bb610b980f7d7e8"
  ]
}

@isocolsky
Copy link
Contributor

utACK, nicely done, very straight forward

@isocolsky
Copy link
Contributor

Regarding the getmempoolentry API. Do you think it is an absolute requirement given that the mempool is huge nowadays? Or maybe we can move forward with the less performant version and then upgrade?

@dabura667
Copy link
Author

Looking back on this:

  1. We should probably cut off after 8 decimal places
  2. If we could cache the getrawmempool true results and clear the cache after every new block it shouldn't be too bad... but yeah, I piped getrawmempool into a file the other day and it took my quad core gaming PC 2 seconds. getmempoolentry was a couple milliseconds.

Slush seems to be pushing for bitcoin Core to include the Bitcore patches into Core. (Mainly all the indexes)

Satoshilabs might be able to help bump bitcore up to support segwit and later versions of Core.

@karelbilek
Copy link

Hello, thanks for this work, we will be adding this to satoshilabs fork :)

@dabura667
Copy link
Author

@Runn1ng just FYI getmempoolentry is more efficient than getrawmempool and parsing in nodeJS.

bitcoin/bitcoin#10300 (comment)

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

Successfully merging this pull request may close these issues.

4 participants