-
Notifications
You must be signed in to change notification settings - Fork 155
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
rpc: implement gettxout JSON-RPC method for SPV mode #1903
Conversation
1449fb3
to
9661a7c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but untested. I just have a few thoughts, but nothing to change except a go generate.
9661a7c
to
946c23b
Compare
internal/rpchelp/helpdescs_en_US.go
Outdated
"gettxoutresult-confirmations": "The number of confirmations", | ||
"gettxoutresult-value": "The transaction amount in DCR", | ||
"gettxoutresult-scriptPubKey": "The public key script used to pay coins as a JSON object", | ||
"gettxoutresult-version": "The transaction version", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The transaction version isn't set in our result at all. There is no field for it, but it would be useful.
Should this even be the transaction version, and not the script version? Or should we include both?
I went to check dcrd to see what it used for this, and it also has this same help text describing a transaction version, but the result similarly has no version field.
cc @davecgh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It used to be the transaction version, but that was removed by @rstaudt2 in decred/dcrd@d05271c. It looks like the help entry wasn't removed as well though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That aside, I think the RPC should be updated to return a version
field under scriptPubKey
for the script version. This is going to become important when we introduce a new version. I'll open an issue on dcrd to add that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see decred/dcrd#2650 is already open to add scriptPubKey.version
for dcrd. Will need to bump github.com/decred/dcrd/rpc/jsonrpc/types/v3
to v4/master (after the dcrd pr is merged) to be able to set that value in wallet. Any plans to bump dcrd deps versions for wallet soon @jrick? I can open a PR for that if no one else is available to get on it sooner; I suspect I'll need the deps updated for something else on dcrdex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dep bump is happening soon. I have a half finished diff sitting in my repo.
In RPC mode, the method performs passthrough manually, to keep existing behavior. In SPV mode, only wallet-related unspent outputs can be looked up currently.
946c23b
to
f595319
Compare
In RPC mode, the method performs passthrough manually, to keep
existing behavior.
In SPV mode, only wallet-related unspent outputs can be looked up
currently.