mirror of
https://github.com/guggero/chantools.git
synced 2026-08-17 13:07:40 +02:00
zombierecovery-makeoffer: fix witness data for psbt package.
We need to make sure we populate all the necessary witness/nonwitness because for taproot inputs we need the prevout so we check for it in the hashcash creation.
This commit is contained in:
parent
a0e5f0613d
commit
78c41b4acf
1 changed files with 12 additions and 4 deletions
|
|
@ -369,10 +369,8 @@ func (c *zombieRecoveryMakeOfferCommand) Execute(_ *cobra.Command,
|
|||
return fmt.Errorf("error creating PSBT from TX: %w", err)
|
||||
}
|
||||
|
||||
signer := &lnd.Signer{
|
||||
ExtendedKey: extendedKey,
|
||||
ChainParams: chainParams,
|
||||
}
|
||||
// First we add the necessary information to the psbt package so that
|
||||
// we can sign the transaction with SIGHASH_ALL.
|
||||
for idx, txIn := range inputs {
|
||||
channel := keys1.Channels[idx]
|
||||
|
||||
|
|
@ -399,6 +397,16 @@ func (c *zombieRecoveryMakeOfferCommand) Execute(_ *cobra.Command,
|
|||
Value: channel.theirKey.SerializeCompressed(),
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
// Loop a second time through the inputs and sign each input. We now
|
||||
// have all the witness/nonwitness data filled in the psbt package.
|
||||
signer := &lnd.Signer{
|
||||
ExtendedKey: extendedKey,
|
||||
ChainParams: chainParams,
|
||||
}
|
||||
for idx, txIn := range inputs {
|
||||
channel := keys1.Channels[idx]
|
||||
|
||||
keyDesc := keychain.KeyDescriptor{
|
||||
PubKey: channel.ourKey,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue