Skip to content

Commit

Permalink
Merge pull request #120 from ziggie1984/master
Browse files Browse the repository at this point in the history
Fix Partial Signature Signing.
  • Loading branch information
guggero authored Jan 30, 2024
2 parents a0e5f06 + 78c41b4 commit cf4cabb
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions cmd/chantools/zombierecovery_makeoffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand All @@ -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,
Expand Down

0 comments on commit cf4cabb

Please sign in to comment.