mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 23:02:44 +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:
@@ -17,6 +17,7 @@ import (
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/lightningnetwork/lnd/chainntnfs"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/clock"
|
||||
"github.com/lightningnetwork/lnd/contractcourt"
|
||||
"github.com/lightningnetwork/lnd/htlcswitch"
|
||||
"github.com/lightningnetwork/lnd/input"
|
||||
@@ -360,6 +361,12 @@ func createTestPeer(notifier chainntnfs.ChainNotifier, publTx chan *wire.MsgTx,
|
||||
contractcourt.ChainArbitratorConfig{
|
||||
Notifier: notifier,
|
||||
ChainIO: chainIO,
|
||||
IsForwardedHTLC: func(chanID lnwire.ShortChannelID,
|
||||
htlcIndex uint64) bool {
|
||||
|
||||
return true
|
||||
},
|
||||
Clock: clock.NewDefaultClock(),
|
||||
}, dbAlice,
|
||||
)
|
||||
chainArb.WatchNewChannel(aliceChannelState)
|
||||
|
Reference in New Issue
Block a user