Merge pull request #6586 from Crypt-iQ/nil_htlcset

contractcourt: make empty htlcSets for closed channels
This commit is contained in:
Olaoluwa Osuntokun 2022-05-28 19:59:25 -07:00 committed by GitHub
commit 1e0d6ec0ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -601,11 +601,13 @@ func (c *ChainArbitrator) Start() error {
return c.ResolveContract(chanPoint)
}
// We can also leave off the set of HTLC's here as since the
// channel is already in the process of being full resolved, no
// new HTLC's will be added.
// We create an empty map of HTLC's here since it's possible
// that the channel is in StateDefault and updateActiveHTLCs is
// called. We want to avoid writing to an empty map. Since the
// channel is already in the process of being resolved, no new
// HTLCs will be added.
c.activeChannels[chanPoint] = NewChannelArbitrator(
arbCfg, nil, chanLog,
arbCfg, make(map[HtlcSetKey]htlcSet), chanLog,
)
}