mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 23:21:12 +02:00
multi: update to fn v2
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/lightningnetwork/lnd/chainntnfs"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/fn"
|
||||
"github.com/lightningnetwork/lnd/fn/v2"
|
||||
graphdb "github.com/lightningnetwork/lnd/graph/db"
|
||||
"github.com/lightningnetwork/lnd/input"
|
||||
"github.com/lightningnetwork/lnd/kvdb"
|
||||
@@ -1537,9 +1537,9 @@ func (b *BreachArbitrator) createSweepTx(
|
||||
// outputs from the regular, BTC only outputs. So we only need one such
|
||||
// output, which'll carry the custom channel "valuables" from both the
|
||||
// breached commitment and HTLC outputs.
|
||||
hasBlobs := fn.Any(func(i input.Input) bool {
|
||||
hasBlobs := fn.Any(inputs, func(i input.Input) bool {
|
||||
return i.ResolutionBlob().IsSome()
|
||||
}, inputs)
|
||||
})
|
||||
if hasBlobs {
|
||||
weightEstimate.AddP2TROutput()
|
||||
}
|
||||
@@ -1624,7 +1624,7 @@ func (b *BreachArbitrator) sweepSpendableOutputsTxn(txWeight lntypes.WeightUnit,
|
||||
// First, we'll add the extra sweep output if it exists, subtracting the
|
||||
// amount from the sweep amt.
|
||||
if b.cfg.AuxSweeper.IsSome() {
|
||||
extraChangeOut.WhenResult(func(o sweep.SweepOutput) {
|
||||
extraChangeOut.WhenOk(func(o sweep.SweepOutput) {
|
||||
sweepAmt -= o.Value
|
||||
|
||||
txn.AddTxOut(&o.TxOut)
|
||||
@@ -1697,7 +1697,7 @@ func (b *BreachArbitrator) sweepSpendableOutputsTxn(txWeight lntypes.WeightUnit,
|
||||
return &justiceTxCtx{
|
||||
justiceTx: txn,
|
||||
sweepAddr: pkScript,
|
||||
extraTxOut: extraChangeOut.Option(),
|
||||
extraTxOut: extraChangeOut.OkToSome(),
|
||||
fee: txFee,
|
||||
inputs: inputs,
|
||||
}, nil
|
||||
|
Reference in New Issue
Block a user