From a6a8415a266b7dba2933bd2145ebb213098407d9 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Sat, 6 Jan 2024 05:45:33 +0800 Subject: [PATCH] contractcourt: make sure `ChainArbitrator` is started properly We should not fail to start the node if a republish attempt failed for a channel's closing tx. Instead, we log an error to continue the startup and let other channels continue their operations. --- contractcourt/chain_arbitrator.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contractcourt/chain_arbitrator.go b/contractcourt/chain_arbitrator.go index acae5b678..acf3512af 100644 --- a/contractcourt/chain_arbitrator.go +++ b/contractcourt/chain_arbitrator.go @@ -548,9 +548,10 @@ func (c *ChainArbitrator) Start() error { c.activeChannels[chanPoint] = channelArb // Republish any closing transactions for this channel. - err = c.publishClosingTxs(channel) + err = c.republishClosingTxs(channel) if err != nil { - return err + log.Errorf("Failed to republish closing txs for "+ + "channel %v", chanPoint) } } @@ -825,10 +826,10 @@ func (c *ChainArbitrator) dispatchBlocks( } } -// publishClosingTxs will load any stored cooperative or unilater closing +// republishClosingTxs will load any stored cooperative or unilateral closing // transactions and republish them. This helps ensure propagation of the // transactions in the event that prior publications failed. -func (c *ChainArbitrator) publishClosingTxs( +func (c *ChainArbitrator) republishClosingTxs( channel *channeldb.OpenChannel) error { // If the channel has had its unilateral close broadcasted already,