lnwallet/chanfunding: add Inputs/Outputs to assemblers

This will be used to try to estimate how much the funding transaction
will decrease our wallet balance.
This commit is contained in:
Johan T. Halseth committed 2021-01-19 10:53:45 +01:00
1 parent b2857bf392
commit 4a4e0c73f7
4 files changed
+103

No files matched your search

+22
View File
@@ -152,6 +152,28 @@ func (f *FullIntent) CompileFundingTx(extraInputs []*wire.TxIn,
return fundingTx, nil
}
// Inputs returns all inputs to the final funding transaction that we
// know about. Since this funding transaction is created all from our wallet,
// it will be all inputs.
func (f *FullIntent) Inputs() []wire.OutPoint {
var ins []wire.OutPoint
for _, coin := range f.InputCoins {
ins = append(ins, coin.OutPoint)
}
return ins
}
// Outputs returns all outputs of the final funding transaction that we
// know about. This will be the funding output and the change outputs going
// back to our wallet.
func (f *FullIntent) Outputs() []*wire.TxOut {
outs := f.ShimIntent.Outputs()
outs = append(outs, f.ChangeOutputs...)
return outs
}
// Cancel allows the caller to cancel a funding Intent at any time. This will
// return any resources such as coins back to the eligible pool to be used in
// order channel fundings.