From 79341fc63e04215a3e03b500cda09af6200859bb Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Mon, 16 Apr 2018 15:18:38 +0200 Subject: [PATCH] contractcourt/chain_watcher: move log message This move the log message "channel marked pending-closed" to the point where the channel actually has been marked pending closed, instead of before the database transaction has been done. --- contractcourt/chain_watcher.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contractcourt/chain_watcher.go b/contractcourt/chain_watcher.go index c3d78a63..fe4f3290 100644 --- a/contractcourt/chain_watcher.go +++ b/contractcourt/chain_watcher.go @@ -754,10 +754,14 @@ func (c *chainWatcher) dispatchContractBreach(spendEvent *chainntnfs.SpendDetail ShortChanID: c.chanState.ShortChanID, } + if err := c.chanState.CloseChannel(&closeSummary); err != nil { + return err + } + log.Infof("Breached channel=%v marked pending-closed", c.chanState.FundingOutpoint) - return c.chanState.CloseChannel(&closeSummary) + return nil } // CooperativeCloseCtx is a transactional object that's used by external