multi: formatting and comment fixes
This commit is contained in:
160 files changed
+159
-260
No files matched your search
@@ -411,7 +411,6 @@ func (cm *circuitMap) cleanClosedChannels() error {
|
||||
return nil
|
||||
})
|
||||
return err
|
||||
|
||||
}, func() {
|
||||
// Reset the sets.
|
||||
circuitKeySet = make(map[CircuitKey]struct{})
|
||||
|
||||
@@ -265,10 +265,8 @@ func TestCircuitMapCleanClosedChannels(t *testing.T) {
|
||||
for _, ks := range test.untouched {
|
||||
assertKeystoneNotDeleted(t, circuitMap, ks)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// createTestCircuit creates a circuit for testing with its incoming key being
|
||||
|
||||
+1
-1
@@ -1130,6 +1130,7 @@ func (l *channelLink) htlcManager() {
|
||||
if !shouldAdjustCommitFee(
|
||||
newCommitFee, commitFee, minRelayFee,
|
||||
) {
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -2571,7 +2572,6 @@ func (l *channelLink) ShutdownIfChannelClean() error {
|
||||
// updateChannelFee updates the commitment fee-per-kw on this channel by
|
||||
// committing to an update_fee message.
|
||||
func (l *channelLink) updateChannelFee(feePerKw chainfee.SatPerKWeight) error {
|
||||
|
||||
l.log.Infof("updating commit fee to %v sat/kw", feePerKw)
|
||||
|
||||
// We skip sending the UpdateFee message if the channel is not
|
||||
|
||||
@@ -5752,7 +5752,6 @@ func TestForwardingAsymmetricTimeLockPolicies(t *testing.T) {
|
||||
// TestCheckHtlcForward tests that a link is properly enforcing the HTLC
|
||||
// forwarding policy.
|
||||
func TestCheckHtlcForward(t *testing.T) {
|
||||
|
||||
fetchLastChannelUpdate := func(lnwire.ShortChannelID) (
|
||||
*lnwire.ChannelUpdate, error) {
|
||||
|
||||
|
||||
@@ -590,7 +590,6 @@ func (m *memoryMailBox) AddMessage(msg lnwire.Message) error {
|
||||
func (m *memoryMailBox) AddPacket(pkt *htlcPacket) error {
|
||||
m.pktCond.L.Lock()
|
||||
switch htlc := pkt.htlc.(type) {
|
||||
|
||||
// Split off Settle/Fail packets into the repPkts queue.
|
||||
case *lnwire.UpdateFulfillHTLC, *lnwire.UpdateFailHTLC:
|
||||
if _, ok := m.repIndex[pkt.inKey()]; ok {
|
||||
@@ -674,6 +673,7 @@ func (m *memoryMailBox) DustPackets() (lnwire.MilliSatoshi,
|
||||
if m.isDust(
|
||||
m.feeRate, false, true, addPkt.amount.ToSatoshis(),
|
||||
) {
|
||||
|
||||
localDustSum += addPkt.amount
|
||||
}
|
||||
|
||||
@@ -681,6 +681,7 @@ func (m *memoryMailBox) DustPackets() (lnwire.MilliSatoshi,
|
||||
if m.isDust(
|
||||
m.feeRate, false, false, addPkt.amount.ToSatoshis(),
|
||||
) {
|
||||
|
||||
remoteDustSum += addPkt.amount
|
||||
}
|
||||
}
|
||||
|
||||
+5
-4
@@ -986,17 +986,18 @@ var _ htlcNotifier = (*mockHTLCNotifier)(nil)
|
||||
type mockHTLCNotifier struct{}
|
||||
|
||||
func (h *mockHTLCNotifier) NotifyForwardingEvent(key HtlcKey, info HtlcInfo,
|
||||
eventType HtlcEventType) {
|
||||
eventType HtlcEventType) { // nolint:whitespace
|
||||
}
|
||||
|
||||
func (h *mockHTLCNotifier) NotifyLinkFailEvent(key HtlcKey, info HtlcInfo,
|
||||
eventType HtlcEventType, linkErr *LinkError, incoming bool) {
|
||||
eventType HtlcEventType, linkErr *LinkError,
|
||||
incoming bool) { // nolint:whitespace
|
||||
}
|
||||
|
||||
func (h *mockHTLCNotifier) NotifyForwardingFailEvent(key HtlcKey,
|
||||
eventType HtlcEventType) {
|
||||
eventType HtlcEventType) { // nolint:whitespace
|
||||
}
|
||||
|
||||
func (h *mockHTLCNotifier) NotifySettleEvent(key HtlcKey,
|
||||
preimage lntypes.Preimage, eventType HtlcEventType) {
|
||||
preimage lntypes.Preimage, eventType HtlcEventType) { // nolint:whitespace
|
||||
}
|
||||
@@ -215,6 +215,5 @@ func TestNetworkResultStore(t *testing.T) {
|
||||
if i >= 2 && err != ErrPaymentIDNotFound {
|
||||
t.Fatalf("expected ErrPaymentIDNotFound, got %v", err)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -728,7 +728,7 @@ func (s *Switch) ForwardPackets(linkQuit chan struct{},
|
||||
return nil
|
||||
}
|
||||
|
||||
// logFwdErrs logs any errors received on `fwdChan`
|
||||
// logFwdErrs logs any errors received on `fwdChan`.
|
||||
func (s *Switch) logFwdErrs(num *int, wg *sync.WaitGroup, fwdChan chan error) {
|
||||
defer s.wg.Done()
|
||||
|
||||
|
||||
@@ -2961,7 +2961,6 @@ func testHtcNotifier(t *testing.T, testOpts []serverOption, iterations int,
|
||||
checkHtlcEvents(t, aliceEvents.Updates(), alice)
|
||||
checkHtlcEvents(t, bobEvents.Updates(), bob)
|
||||
checkHtlcEvents(t, carolEvents.Updates(), carol)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user