contractcourt: improve robustness
This commit is contained in:
1 file changed
+2
-2
@@ -682,7 +682,7 @@ func (c *ChannelArbitrator) relaunchResolvers(commitSet *CommitSet,
|
|||||||
// chain actions may exclude some information, but we cannot recover it
|
// chain actions may exclude some information, but we cannot recover it
|
||||||
// for these older nodes at the moment.
|
// for these older nodes at the moment.
|
||||||
var confirmedHTLCs []channeldb.HTLC
|
var confirmedHTLCs []channeldb.HTLC
|
||||||
if commitSet != nil {
|
if commitSet != nil && commitSet.ConfCommitKey != nil {
|
||||||
confirmedHTLCs = commitSet.HtlcSets[*commitSet.ConfCommitKey]
|
confirmedHTLCs = commitSet.HtlcSets[*commitSet.ConfCommitKey]
|
||||||
} else {
|
} else {
|
||||||
chainActions, err := c.log.FetchChainActions()
|
chainActions, err := c.log.FetchChainActions()
|
||||||
@@ -2203,7 +2203,7 @@ func (c *ChannelArbitrator) constructChainActions(confCommitSet *CommitSet,
|
|||||||
// then this is an older node that had a pending close channel before
|
// then this is an older node that had a pending close channel before
|
||||||
// the CommitSet was introduced. In this case, we'll just return the
|
// the CommitSet was introduced. In this case, we'll just return the
|
||||||
// existing ChainActionMap they had on disk.
|
// existing ChainActionMap they had on disk.
|
||||||
if confCommitSet == nil {
|
if confCommitSet == nil || confCommitSet.ConfCommitKey == nil {
|
||||||
return c.log.FetchChainActions()
|
return c.log.FetchChainActions()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user