-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
psbt: add verification method for utxo data #1964
Conversation
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.
Thanks for the fix! Idea definitely makes sense, just a few comments around style and naming.
268617b
to
298ab4b
Compare
Thank you for taking a look so fast, really appreciate this :) |
298ab4b
to
8c2adbc
Compare
8c2adbc
to
42d675e
Compare
btcutil/psbt/utils.go
Outdated
// type and the second reason is that the sighash calculation for taproot inputs | ||
// include the previous output pkscripts. | ||
func InputsReadyToSign(packet *Packet) error { | ||
VerifyInputOutputLen(packet, true, true) |
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 guess we want to return an error if this function "fails"?
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.
Totally thank you
the new InputsReadyToSign method makes sure that inputs have either the nonWitnessUtxo or the witnessUtxo data set.
42d675e
to
b554add
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.
LGTM 🎉
Pull Request Test Coverage Report for Build 4476808113
💛 - Coveralls |
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.
Thanks for this 🎉
This adds a method to verify the utxo data of a psbt package especially the
NonWitnessUtxo | WitnessUtxo
data.This will be used in other packages to make sure we have the correct psbt structure with all relevant input fields populated.
Relates to lightningnetwork/lnd#7527
Happy to discuss other approaches, other PRs which call this function in lnd and btcwallet would follow if we want this function in this package ?