-
Notifications
You must be signed in to change notification settings - Fork 13
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
Signing a PSBT with some inputs not having utxo throws ValueError #52
Comments
Yes, it looks like we should just return python-bitcointx/bitcointx/core/psbt.py Lines 925 to 929 in 41e25ed
a few lines above there's also a check if the index is set on UTXO: python-bitcointx/bitcointx/core/psbt.py Lines 921 to 923 in 41e25ed
It seems to me that conceptually, in both of this cases we can just return "None" and not throw execption. The only situation where throwing an exception seems to be of value is when someone needs to make sure that all inputs are signable. But "unsignable" inputs return None in other cases such as unrecognized script, and the check can be accomplished just by iterating over I think I will just replace Let me know if you think that there's a better way to handle this |
From my view, I think returning None is right. A caller can always inspect the SignResult object to check (I think?) that the result is as intended. I believe I agree also about |
I released |
I was previously using
sign()
method ofpsbt.PartiallySignedTransaction
with a keystore containing keys for only some inputs, and it was working fine, but I now have a use case where some of the other inputs (which I'm not signing and don't have keys for) are required (see BIP78) to not have the utxo field filled in. When I callsign()
in this case, those inputs throw the above mentioned ValueError (which btw has a trivial typo:'utxo is not set for of PSBT_Input at index {self.index}'
).Currently I only have the ugly option of signing first, then deleting the utxo field. But unless I missed something, it should be possible to call
sign()
on the overall PSBT without it throwing an Exception (though I suppose, it could certainly be an option).The text was updated successfully, but these errors were encountered: