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

rpcclient: ListSinceBlock and ListSinceBlockMinConf docs are dangerously wrong #998

Open
davecgh opened this issue Aug 16, 2017 · 1 comment

Comments

@davecgh
Copy link
Member

davecgh commented Aug 16, 2017

From @FrozenPrincess on September 15, 2016 14:47

ListSinceBlock

// ListSinceBlock returns all transactions added in blocks since the specified
// block hash, or all transactions if it is nil, using the default number of
// minimum confirmations as a filter.

and

ListSinceBlockMinConf

// ListSinceBlockMinConf returns all transactions added in blocks since the
// specified block hash, or all transactions if it is nil, using the specified
// number of minimum confirmations as a filter.

However, that is wrong. The target-confirmation argument in to listsinceblock in bitcoin core does not affect the list of returned transactions, and is not a filter. What it does is only affect the field "lastblock" which btcrpcclient does not expose.

So actually ListSinceBlock and ListSinceBlockMinConf are both identical in btcrpcclient, and incorrectly say they filter the list.

I suggest that the docs get fixed, and the return type of ListSinceBlock and ListSinceBlockMinConf return a struct with a list of transaction and the last block (e.g. bitcoin core:

{
  "transactions": [],
  "lastblock": "0000000000000000018539df4038f99778b61a18310bb7ba108ac240cd62eb9f"
}

The reason I say it's dangerously wrong, as this can very easily lead to people accepting 0-conf transactions when they intended to filter to X confirmations.

Copied from original issue: btcsuite/btcrpcclient#88

@davecgh davecgh changed the title ListSinceBlock and ListSinceBlockMinConf docs are dangerously wrong rpcclient: ListSinceBlock and ListSinceBlockMinConf docs are dangerously wrong Aug 16, 2017
@nhandl3
Copy link

nhandl3 commented Dec 18, 2018

+1 dangerously wrong

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

No branches or pull requests

2 participants