Merge pull request #2839 from joostjager/htlc-expiry-check

link: increase expiry grace delta for exit hop and forwarded htlcs
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2019-04-01 18:15:56 -07:00
commit 893cff60c4
7 files changed
+81 -49

No files matched your search

+7 -5
View File
@@ -727,9 +727,7 @@ func newServer(listenAddrs []net.Addr, chanDB *channeldb.DB, cc *chainControl,
contractBreaches := make(chan *ContractBreachEvent, 1)
s.chainArb = contractcourt.NewChainArbitrator(contractcourt.ChainArbitratorConfig{
ChainHash: *activeNetParams.GenesisHash,
// TODO(roasbeef): properly configure
// * needs to be << or specified final hop time delta
ChainHash: *activeNetParams.GenesisHash,
BroadcastDelta: defaultBroadcastDelta,
NewSweepAddr: func() ([]byte, error) {
return newSweepPkScript(cc.wallet)
@@ -2475,11 +2473,15 @@ func (s *server) peerConnected(conn net.Conn, connReq *connmgr.ConnReq,
localFeatures.Set(lnwire.DataLossProtectRequired)
localFeatures.Set(lnwire.GossipQueriesOptional)
// Now that we've established a connection, create a peer, and it to
// the set of currently active peers.
// Now that we've established a connection, create a peer, and it to the
// set of currently active peers. Configure the peer with a expiry grace
// delta greater than the broadcast delta, to prevent links from
// accepting htlcs that may trigger channel arbitrator force close the
// channel immediately.
p, err := newPeer(
conn, connReq, s, peerAddr, inbound, localFeatures,
cfg.ChanEnableTimeout,
defaultBroadcastDelta+extraExpiryGraceDelta,
)
if err != nil {
srvrLog.Errorf("unable to create peer %v", err)