mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 17:51:33 +02:00
contractcourt+switch: keep channels with timed-out initiated htlcs.
This commit enables the user to specify he is not interested in automatically close channels with pending payments that their corresponding htlcs have timed-out. By requiring a configurable grace period uptime of our node before closing such channels, we give a chance to the other node to properly cancel the htlc and avoid unnecessary on-chain transaction. In mobile it is very important for the user experience as otherwise channels will be force closed more frequently.
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/clock"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
)
|
||||
|
||||
@@ -83,6 +84,7 @@ func TestChainArbitratorRepublishCloses(t *testing.T) {
|
||||
published[tx.TxHash()]++
|
||||
return nil
|
||||
},
|
||||
Clock: clock.NewDefaultClock(),
|
||||
}
|
||||
chainArb := NewChainArbitrator(
|
||||
chainArbCfg, db,
|
||||
@@ -171,6 +173,7 @@ func TestResolveContract(t *testing.T) {
|
||||
PublishTx: func(tx *wire.MsgTx) error {
|
||||
return nil
|
||||
},
|
||||
Clock: clock.NewDefaultClock(),
|
||||
}
|
||||
chainArb := NewChainArbitrator(
|
||||
chainArbCfg, db,
|
||||
|
Reference in New Issue
Block a user