multi: use prev output fetcher in sign desc

pull/70/head
Oliver Gugger 1 year ago
parent bd794843b3
commit 2e9a0f8dbe
No known key found for this signature in database
GPG Key ID: 8E4256593F177720

@ -223,10 +223,11 @@ func sweepRemoteClosed(extendedKey *hdkeychain.ExtendedKey, apiURL,
})
signDescs = append(signDescs, &input.SignDescriptor{
KeyDesc: *target.keyDesc,
WitnessScript: target.script,
Output: prevTxOut,
HashType: txscript.SigHashAll,
KeyDesc: *target.keyDesc,
WitnessScript: target.script,
Output: prevTxOut,
HashType: txscript.SigHashAll,
PrevOutputFetcher: prevOutFetcher,
})
}
}

@ -271,9 +271,10 @@ func sweepTimeLock(extendedKey *hdkeychain.ExtendedKey, apiURL string,
target.commitPoint,
target.delayBasePointDesc.PubKey,
),
WitnessScript: script,
Output: prevTxOut,
HashType: txscript.SigHashAll,
WitnessScript: script,
Output: prevTxOut,
HashType: txscript.SigHashAll,
PrevOutputFetcher: prevOutFetcher,
}
totalOutputValue += target.value
signDescs = append(signDescs, signDesc)

@ -271,9 +271,10 @@ func sweepTimeLockManual(extendedKey *hdkeychain.ExtendedKey, apiURL string,
PkScript: scriptHash,
Value: sweepValue,
},
InputIndex: 0,
SigHashes: sigHashes,
HashType: txscript.SigHashAll,
InputIndex: 0,
SigHashes: sigHashes,
PrevOutputFetcher: prevOutFetcher,
HashType: txscript.SigHashAll,
}
witness, err := input.CommitSpendTimeout(signer, signDesc, sweepTx)
if err != nil {

@ -135,11 +135,12 @@ func (s *Signer) AddPartialSignature(packet *psbt.Packet,
// Now we add our partial signature.
prevOutFetcher := wallet.PsbtPrevOutputFetcher(packet)
signDesc := &input.SignDescriptor{
KeyDesc: keyDesc,
WitnessScript: witnessScript,
Output: utxo,
InputIndex: inputIndex,
HashType: txscript.SigHashAll,
KeyDesc: keyDesc,
WitnessScript: witnessScript,
Output: utxo,
InputIndex: inputIndex,
HashType: txscript.SigHashAll,
PrevOutputFetcher: prevOutFetcher,
SigHashes: txscript.NewTxSigHashes(
packet.UnsignedTx, prevOutFetcher,
),

Loading…
Cancel
Save