Skip to content

Commit f59c0c1

Browse files
committed
channeldb: add NextHeight, fix formatting
1 parent b2d41ee commit f59c0c1

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lnwallet/channel.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5174,9 +5174,7 @@ func (lc *LightningChannel) computeView(view *HtlcView, remoteChain bool,
51745174
// need this to determine which HTLCs are dust, and also the final fee
51755175
// rate.
51765176
view.FeePerKw = commitChain.tip().feePerKw
5177-
5178-
// TODO(roasbeef): also need to pass blob here as well for final
5179-
// balances?
5177+
view.NextHeight = nextHeight
51805178

51815179
// We evaluate the view at this stage, meaning settled and failed HTLCs
51825180
// will remove their corresponding added HTLCs. The resulting filtered
@@ -6677,13 +6675,16 @@ func (lc *LightningChannel) validateAddHtlc(pd *PaymentDescriptor,
66776675
// ReceiveHTLC adds an HTLC to the state machine's remote update log. This
66786676
// method should be called in response to receiving a new HTLC from the remote
66796677
// party.
6680-
func (lc *LightningChannel) ReceiveHTLC(htlc *lnwire.UpdateAddHTLC) (uint64, error) {
6678+
func (lc *LightningChannel) ReceiveHTLC(htlc *lnwire.UpdateAddHTLC) (uint64,
6679+
error) {
6680+
66816681
lc.Lock()
66826682
defer lc.Unlock()
66836683

66846684
if htlc.ID != lc.remoteUpdateLog.htlcCounter {
6685-
return 0, fmt.Errorf("ID %d on HTLC add does not match expected next "+
6686-
"ID %d", htlc.ID, lc.remoteUpdateLog.htlcCounter)
6685+
return 0, fmt.Errorf("ID %d on HTLC add does not match "+
6686+
"expected next ID %d", htlc.ID,
6687+
lc.remoteUpdateLog.htlcCounter)
66876688
}
66886689

66896690
pd := &PaymentDescriptor{

0 commit comments

Comments
 (0)