-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[bug] lnd crashes when not correct psbt data is used as input #7527
Comments
Part of the stack trace when finializing the psbt:
|
Fixed by #7529 |
Out of curiosity, why would this txn {
"txid": "43c79b969d3e8e6cbe198f5b25e8cd03120372eab26578f486bc6258b8677a57",
"hash": "653cc4921119c7f127bb56f125163d279376fd6fa0995f3dd91c2a51e8a108ea",
"version": 2,
"size": 222,
"vsize": 141,
"weight": 561,
"locktime": 200,
"vin": [
{
"txid": "4853a89d083df152f697aa5d63bcd6919ffaa0213b7736d227eed10fd53c6378",
"vout": 0,
"scriptSig": {
"asm": "",
"hex": ""
},
"txinwitness": [
"304402202874d54141b3804267cec7320f4a27ddc22e1c17100c7106630ef40e1f01cb4402200527d5491d94887c7178b58dab73153ba5e027a225eb413f8ab660575ee4907401",
"0384e78028f045c515e8730b67fa96d12e3bd2572d0f312c129872655747f19f40"
],
"sequence": 4294967293
}
],
"vout": [
{
"value": 1.00000000,
"n": 0,
"scriptPubKey": {
"asm": "0 6f7ec5399599d8cfecb5bb5218bd85c6f419fec3",
"desc": "addr(bcrt1qdalv2wv4n8vvlm94hdfp30v9cm6pnlkrqq5flr)#c6nl327t",
"hex": "00146f7ec5399599d8cfecb5bb5218bd85c6f419fec3",
"address": "bcrt1qdalv2wv4n8vvlm94hdfp30v9cm6pnlkrqq5flr",
"type": "witness_v0_keyhash"
}
},
{
"value": 48.99997180,
"n": 1,
"scriptPubKey": {
"asm": "0 f2774e8e9922f3c728d2e30dfec006d8cd6fee53",
"desc": "addr(bcrt1q7fm5ar5eyteuw2xjuvxlasqxmrxklmjnx83cat)#vt5cse08",
"hex": "0014f2774e8e9922f3c728d2e30dfec006d8cd6fee53",
"address": "bcrt1q7fm5ar5eyteuw2xjuvxlasqxmrxklmjnx83cat",
"type": "witness_v0_keyhash"
}
}
]
} with this call $ TX_ID="43c79b969d3e8e6cbe198f5b25e8cd03120372eab26578f486bc6258b8677a57"
$ PSBT=$(bitcoin-cli createpsbt "[{\"txid\":\"${TX_ID}\",\"vout\":0}]" "[{\"bcrt1q2xfvunp3hnl4yc2tn99epl27xqmxnxpp9st8ad\":0.5},{\"bcrt1qvlpe3vvtr7jxgkp5yyqsum795w03n8236uujql\":0.49}]")
$ lncli wallet psbt finalize $PSBT produce this error for lnd?
ContextI was originally trying this on lnd 15 and running into the same errors ziggie fiest reported. And then when I bumped my docker images to 16 started getting these new errors. Also below is the PSBT I'm trying to finalize $ echo $PSBT
cHNidP8BAHECAAAAAVd6Z7hYYryG9HhlsupyAxIDzeglW48ZvmyOPp2Wm8dDAAAAAAD9////AoDw+gIAAAAAFgAUUZLOTDG8/1JhS5lLkP1eMDZpmCFArusCAAAAABYAFGfDmLGLH6RkWDQhAQ5vxaOfGZ1RAAAAAAAAAAA= |
You need to add the UTXO information to each input of the PSBT. You should be able to use |
This worked perfectly, thanks! I simply ran |
Lnd will crash if the provided psbt (funded psbt) is missing the psbt
NonWitnessUtxo
orWitnessUtxo
field. The problem lies here:https://github.com/btcsuite/btcd/blob/master/txscript/hashcache.go#L239
We should check the psbt for this data to prevent any crashing of lnd.
I created the following psbt code which has missing utxo information and will therefore lead to an lnd crash
As already discussed offline we should solve this issue in lnd, meaning that we should check the psbt there before we attempt to calculate any sighashes.
Your environment
lnd
: 0.16 rc3The text was updated successfully, but these errors were encountered: