multi: rename HTLCExpiry to MailboxDeliveryTimeout for clarity

This commit is contained in:
yyforyongyu 2022-10-20 19:15:02 +08:00
parent ae6006a84e
commit 851c82b80e
No known key found for this signature in database
GPG key ID: 9BCD95C4FF296868
3 changed files with 21 additions and 19 deletions

View file

@ -190,15 +190,17 @@ func initSwitchWithDB(startingHeight uint32, db *channeldb.DB) (*Switch, error)
EpochChan: make(chan *chainntnfs.BlockEpoch),
ConfChan: make(chan *chainntnfs.TxConfirmation),
},
FwdEventTicker: ticker.NewForce(DefaultFwdEventInterval),
LogEventTicker: ticker.NewForce(DefaultLogInterval),
AckEventTicker: ticker.NewForce(DefaultAckInterval),
HtlcNotifier: &mockHTLCNotifier{},
Clock: clock.NewDefaultClock(),
HTLCExpiry: time.Hour,
DustThreshold: DefaultDustThreshold,
SignAliasUpdate: signAliasUpdate,
IsAlias: isAlias,
FwdEventTicker: ticker.NewForce(
DefaultFwdEventInterval,
),
LogEventTicker: ticker.NewForce(DefaultLogInterval),
AckEventTicker: ticker.NewForce(DefaultAckInterval),
HtlcNotifier: &mockHTLCNotifier{},
Clock: clock.NewDefaultClock(),
MailboxDeliveryTimeout: time.Hour,
DustThreshold: DefaultDustThreshold,
SignAliasUpdate: signAliasUpdate,
IsAlias: isAlias,
}
return New(cfg, startingHeight)

View file

@ -39,9 +39,9 @@ const (
// fails in a forwarding package.
DefaultAckInterval = 15 * time.Second
// DefaultHTLCExpiry is the duration after which Adds will be cancelled
// if they could not get added to an outgoing commitment.
DefaultHTLCExpiry = time.Minute
// DefaultMailboxDeliveryTimeout is the duration after which Adds will
// be cancelled if they could not get added to an outgoing commitment.
DefaultMailboxDeliveryTimeout = time.Minute
)
var (
@ -202,11 +202,11 @@ type Config struct {
// Clock is a time source for the switch.
Clock clock.Clock
// HTLCExpiry is the interval after which Adds will be cancelled if they
// have not been yet been delivered to a link. The computed deadline
// will expiry this long after the Adds are added to a mailbox via
// AddPacket.
HTLCExpiry time.Duration
// MailboxDeliveryTimeout is the interval after which Adds will be
// cancelled if they have not been yet been delivered to a link. The
// computed deadline will expiry this long after the Adds are added to
// a mailbox via AddPacket.
MailboxDeliveryTimeout time.Duration
// DustThreshold is the threshold in milli-satoshis after which we'll
// fail incoming or outgoing dust payments for a particular channel.
@ -386,7 +386,7 @@ func New(cfg Config, currentHeight uint32) (*Switch, error) {
s.mailOrchestrator = newMailOrchestrator(&mailOrchConfig{
forwardPackets: s.ForwardPackets,
clock: s.cfg.Clock,
expiry: s.cfg.HTLCExpiry,
expiry: s.cfg.MailboxDeliveryTimeout,
failMailboxUpdate: s.failMailboxUpdate,
})

View file

@ -658,7 +658,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
AllowCircularRoute: cfg.AllowCircularRoute,
RejectHTLC: cfg.RejectHTLC,
Clock: clock.NewDefaultClock(),
HTLCExpiry: htlcswitch.DefaultHTLCExpiry,
MailboxDeliveryTimeout: htlcswitch.DefaultMailboxDeliveryTimeout,
DustThreshold: thresholdMSats,
SignAliasUpdate: s.signAliasUpdate,
IsAlias: aliasmgr.IsAlias,