From eeb6ab0b178733e3ba0305b3be2152f454561e1c Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 16 Jan 2018 20:43:24 -0800 Subject: [PATCH] utxonursery: don't mark channel as fully closed in closeAndRemoveIfMature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ChannelArbitrator for this channel will do this, so we don’t need to do it at this point any longer. --- utxonursery.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/utxonursery.go b/utxonursery.go index ee945933..cf8c8926 100644 --- a/utxonursery.go +++ b/utxonursery.go @@ -1393,7 +1393,6 @@ func (c *contractMaturityReport) AddRecoveredHtlc(kid *kidOutput) { maturityRequirement: kid.BlocksToMaturity(), maturityHeight: kid.ConfHeight() + kid.BlocksToMaturity(), }) - } // closeAndRemoveIfMature removes a particular channel from the channel index @@ -1415,18 +1414,6 @@ func (u *utxoNursery) closeAndRemoveIfMature(chanPoint *wire.OutPoint) error { return nil } - // Now that the sweeping transaction has been broadcast, for - // each of the immature outputs, we'll mark them as being fully - // closed within the database. - err = u.cfg.DB.MarkChanFullyClosed(chanPoint) - if err != nil { - utxnLog.Errorf("Unable to mark channel=%v as fully "+ - "closed: %v", chanPoint, err) - return err - } - - utxnLog.Infof("Marked Channel(%s) as fully closed", chanPoint) - // Now that the channel is fully closed, we remove the channel from the // nursery store here. This preserves the invariant that we never remove // a channel unless it is mature, as this is the only place the utxo