lnwallet: modify FetchInputInfo to return additional information for utxos

This commit is contained in:
Wilmer Paulino committed 2019-08-22 13:49:41 -07:00
1 parent 8b398bdbd1
commit 9e8a1707cc
5 files changed
+54 -20

No files matched your search

+8 -5
View File
@@ -496,23 +496,26 @@ func (w *WalletKit) BumpFee(ctx context.Context,
//
// We'll gather all of the information required by the UtxoSweeper in
// order to sweep the output.
txOut, err := w.cfg.Wallet.FetchInputInfo(op)
utxo, err := w.cfg.Wallet.FetchInputInfo(op)
if err != nil {
return nil, err
}
var witnessType input.WitnessType
switch {
case txscript.IsPayToWitnessPubKeyHash(txOut.PkScript):
switch utxo.AddressType {
case lnwallet.WitnessPubKey:
witnessType = input.WitnessKeyHash
case txscript.IsPayToScriptHash(txOut.PkScript):
case lnwallet.NestedWitnessPubKey:
witnessType = input.NestedWitnessKeyHash
default:
return nil, fmt.Errorf("unknown input witness %v", op)
}
signDesc := &input.SignDescriptor{
Output: txOut,
Output: &wire.TxOut{
PkScript: utxo.PkScript,
Value: int64(utxo.Value),
},
HashType: txscript.SigHashAll,
}