Skip to content

Commit 2e9a0f8

Browse files
committed
multi: use prev output fetcher in sign desc
1 parent bd79484 commit 2e9a0f8

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

cmd/chantools/sweepremoteclosed.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,11 @@ func sweepRemoteClosed(extendedKey *hdkeychain.ExtendedKey, apiURL,
223223
})
224224

225225
signDescs = append(signDescs, &input.SignDescriptor{
226-
KeyDesc: *target.keyDesc,
227-
WitnessScript: target.script,
228-
Output: prevTxOut,
229-
HashType: txscript.SigHashAll,
226+
KeyDesc: *target.keyDesc,
227+
WitnessScript: target.script,
228+
Output: prevTxOut,
229+
HashType: txscript.SigHashAll,
230+
PrevOutputFetcher: prevOutFetcher,
230231
})
231232
}
232233
}

cmd/chantools/sweeptimelock.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,10 @@ func sweepTimeLock(extendedKey *hdkeychain.ExtendedKey, apiURL string,
271271
target.commitPoint,
272272
target.delayBasePointDesc.PubKey,
273273
),
274-
WitnessScript: script,
275-
Output: prevTxOut,
276-
HashType: txscript.SigHashAll,
274+
WitnessScript: script,
275+
Output: prevTxOut,
276+
HashType: txscript.SigHashAll,
277+
PrevOutputFetcher: prevOutFetcher,
277278
}
278279
totalOutputValue += target.value
279280
signDescs = append(signDescs, signDesc)

cmd/chantools/sweeptimelockmanual.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,10 @@ func sweepTimeLockManual(extendedKey *hdkeychain.ExtendedKey, apiURL string,
271271
PkScript: scriptHash,
272272
Value: sweepValue,
273273
},
274-
InputIndex: 0,
275-
SigHashes: sigHashes,
276-
HashType: txscript.SigHashAll,
274+
InputIndex: 0,
275+
SigHashes: sigHashes,
276+
PrevOutputFetcher: prevOutFetcher,
277+
HashType: txscript.SigHashAll,
277278
}
278279
witness, err := input.CommitSpendTimeout(signer, signDesc, sweepTx)
279280
if err != nil {

lnd/signer.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,12 @@ func (s *Signer) AddPartialSignature(packet *psbt.Packet,
135135
// Now we add our partial signature.
136136
prevOutFetcher := wallet.PsbtPrevOutputFetcher(packet)
137137
signDesc := &input.SignDescriptor{
138-
KeyDesc: keyDesc,
139-
WitnessScript: witnessScript,
140-
Output: utxo,
141-
InputIndex: inputIndex,
142-
HashType: txscript.SigHashAll,
138+
KeyDesc: keyDesc,
139+
WitnessScript: witnessScript,
140+
Output: utxo,
141+
InputIndex: inputIndex,
142+
HashType: txscript.SigHashAll,
143+
PrevOutputFetcher: prevOutFetcher,
143144
SigHashes: txscript.NewTxSigHashes(
144145
packet.UnsignedTx, prevOutFetcher,
145146
),

0 commit comments

Comments
 (0)