Comments (3)
Yes, it looks like we should just return None
if utxo is not set, now it always raises an exception
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
index
on the input may be unset if someone created PSBT_Input
directly and did not supply or did not set the index.
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 psbt.inputs
doing if inp.sign(...) is None:
I think I will just replace raise ValueError(...)
with return None
in both cases: #53
Let me know if you think that there's a better way to handle this
from python-bitcointx.
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 index
; I don't have such a use case right now, but I could maybe imagine it.
from python-bitcointx.
I released v1.1.1.post2
with the fix
from python-bitcointx.
Related Issues (20)
- Can DeserializationValueBoundsError be triggered by a valid tx? HOT 6
- Taproot support HOT 18
- BIP32 test vector 5 should be added to tests and checked HOT 5
- How to handle libsecp256k1 ABI non-guarantees of stability HOT 5
- CPubKey class and invalid pubkeys - should the API be changed ?
- Potential problem with RIPEMD160 removal from newer OpenSSL versions by default HOT 2
- On MacOS-latest, openssl import fails (openssl is used for non-strict sig verification) HOT 1
- Consider adding scriptWitness to CTxIn
- sign-psbt.py example does not support electrum's testnet xpub encoding for p2wsh HOT 3
- Adding bech32 spending example HOT 4
- libbitcoinconsensus undefined symbol HOT 4
- Use libsecp256k1 v0.2.0? HOT 11
- Incompatibility with OpenSSL 3 HOT 9
- psbt.sign not support pubkey type witness_v1_taproot HOT 1
- CScript.witness_version() returns 0x51 instead of 1 for taproot HOT 13
- Iibbitcoinconsensus is deprecated by Core
- secp256k1 library not found HOT 2
- Consider OP_1NEGATE handling in CScriptOp (as per linked issue from Core) HOT 1
- Issues with configure bitcointx to work with libsecp256k1 HOT 2
- tapInternalKey issue while creating the transaction
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-bitcointx.