Skip to content

Commit cf4cabb

Browse files
authored
Merge pull request #120 from ziggie1984/master
Fix Partial Signature Signing.
2 parents a0e5f06 + 78c41b4 commit cf4cabb

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

cmd/chantools/zombierecovery_makeoffer.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,8 @@ func (c *zombieRecoveryMakeOfferCommand) Execute(_ *cobra.Command,
369369
return fmt.Errorf("error creating PSBT from TX: %w", err)
370370
}
371371

372-
signer := &lnd.Signer{
373-
ExtendedKey: extendedKey,
374-
ChainParams: chainParams,
375-
}
372+
// First we add the necessary information to the psbt package so that
373+
// we can sign the transaction with SIGHASH_ALL.
376374
for idx, txIn := range inputs {
377375
channel := keys1.Channels[idx]
378376

@@ -399,6 +397,16 @@ func (c *zombieRecoveryMakeOfferCommand) Execute(_ *cobra.Command,
399397
Value: channel.theirKey.SerializeCompressed(),
400398
},
401399
)
400+
}
401+
402+
// Loop a second time through the inputs and sign each input. We now
403+
// have all the witness/nonwitness data filled in the psbt package.
404+
signer := &lnd.Signer{
405+
ExtendedKey: extendedKey,
406+
ChainParams: chainParams,
407+
}
408+
for idx, txIn := range inputs {
409+
channel := keys1.Channels[idx]
402410

403411
keyDesc := keychain.KeyDescriptor{
404412
PubKey: channel.ourKey,

0 commit comments

Comments
 (0)