@@ -93,9 +93,9 @@ type BreachCloseInfo struct {
9393// HTLCs to determine if any additional actions need to be made based on the
9494// remote party's commitments.
9595type CommitSet struct {
96- // ConfCommitKey if non-nil, identifies the commitment that was
96+ // When the ConfCommitKey is set, it signals that the commitment tx was
9797 // confirmed in the chain.
98- ConfCommitKey * HtlcSetKey
98+ ConfCommitKey fn. Option [ HtlcSetKey ]
9999
100100 // HtlcSets stores the set of all known active HTLC for each active
101101 // commitment at the time of channel closure.
@@ -509,7 +509,7 @@ func (c *chainWatcher) handleUnknownLocalState(
509509
510510 // If this is our commitment transaction, then we try to act even
511511 // though we won't be able to sweep HTLCs.
512- chainSet .commitSet .ConfCommitKey = & LocalHtlcSet
512+ chainSet .commitSet .ConfCommitKey = fn . Some ( LocalHtlcSet )
513513 if err := c .dispatchLocalForceClose (
514514 commitSpend , broadcastStateNum , chainSet .commitSet ,
515515 ); err != nil {
@@ -806,7 +806,7 @@ func (c *chainWatcher) handleKnownLocalState(
806806 return false , nil
807807 }
808808
809- chainSet .commitSet .ConfCommitKey = & LocalHtlcSet
809+ chainSet .commitSet .ConfCommitKey = fn . Some ( LocalHtlcSet )
810810 if err := c .dispatchLocalForceClose (
811811 commitSpend , broadcastStateNum , chainSet .commitSet ,
812812 ); err != nil {
@@ -844,7 +844,7 @@ func (c *chainWatcher) handleKnownRemoteState(
844844 log .Infof ("Remote party broadcast base set, " +
845845 "commit_num=%v" , chainSet .remoteStateNum )
846846
847- chainSet .commitSet .ConfCommitKey = & RemoteHtlcSet
847+ chainSet .commitSet .ConfCommitKey = fn . Some ( RemoteHtlcSet )
848848 err := c .dispatchRemoteForceClose (
849849 commitSpend , chainSet .remoteCommit ,
850850 chainSet .commitSet ,
@@ -869,7 +869,7 @@ func (c *chainWatcher) handleKnownRemoteState(
869869 log .Infof ("Remote party broadcast pending set, " +
870870 "commit_num=%v" , chainSet .remoteStateNum + 1 )
871871
872- chainSet .commitSet .ConfCommitKey = & RemotePendingHtlcSet
872+ chainSet .commitSet .ConfCommitKey = fn . Some ( RemotePendingHtlcSet )
873873 err := c .dispatchRemoteForceClose (
874874 commitSpend , * chainSet .remotePendingCommit ,
875875 chainSet .commitSet ,
@@ -936,7 +936,7 @@ func (c *chainWatcher) handlePossibleBreach(commitSpend *chainntnfs.SpendDetail,
936936 // only used to ensure a nil-pointer-dereference doesn't occur and is
937937 // not used otherwise. The HTLC's may not exist for the
938938 // RemotePendingHtlcSet.
939- chainSet .commitSet .ConfCommitKey = & RemoteHtlcSet
939+ chainSet .commitSet .ConfCommitKey = fn . Some ( RemoteHtlcSet )
940940
941941 // THEY'RE ATTEMPTING TO VIOLATE THE CONTRACT LAID OUT WITHIN THE
942942 // PAYMENT CHANNEL. Therefore we close the signal indicating a revoked
@@ -997,7 +997,7 @@ func (c *chainWatcher) handleUnknownRemoteState(
997997 // means we won't be able to recover any HTLC funds.
998998 //
999999 // TODO(halseth): can we try to recover some HTLCs?
1000- chainSet .commitSet .ConfCommitKey = & RemoteHtlcSet
1000+ chainSet .commitSet .ConfCommitKey = fn . Some ( RemoteHtlcSet )
10011001 err := c .dispatchRemoteForceClose (
10021002 commitSpend , channeldb.ChannelCommitment {},
10031003 chainSet .commitSet , commitPoint ,
0 commit comments