Skip to content

Commit

Permalink
refactor: use a more straightforward return value
Browse files Browse the repository at this point in the history
Signed-off-by: fuyangpengqi <[email protected]>
  • Loading branch information
fuyangpengqi committed Feb 18, 2025
1 parent 01819f0 commit ef968ea
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion channeldb/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -3146,7 +3146,7 @@ func (c *OpenChannel) RemoteCommitChainTip() (*CommitDiff, error) {
return nil, err
}

return cd, err
return cd, nil
}

// UnsignedAckedUpdates retrieves the persisted unsigned acked remote log
Expand Down
2 changes: 1 addition & 1 deletion channeldb/migration32/mission_control_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ func serializeNewResult(rp *paymentResultNew) ([]byte, []byte, error) {
return nil, nil, err
}

return key, buff.Bytes(), err
return key, buff.Bytes(), nil
}

// getResultKeyNew returns a byte slice representing a unique key for this
Expand Down
4 changes: 2 additions & 2 deletions contractcourt/htlc_timeout_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ func (h *htlcTimeoutResolver) sweepTimeoutTx() error {
return err
}

return err
return nil
}

// resolveSecondLevelTxLegacy sends a second level timeout transaction to the
Expand Down Expand Up @@ -593,7 +593,7 @@ func (h *htlcTimeoutResolver) waitForConfirmedSpend(op *wire.OutPoint,
return nil, err
}

return spend, err
return spend, nil
}

// Stop signals the resolver to cancel any current resolution processes, and
Expand Down
2 changes: 1 addition & 1 deletion lnrpc/invoicesrpc/addinvoice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (h *hopHintsConfigMock) FetchChannelEdgesByID(chanID uint64) (
policy2, ok := args.Get(2).(*models.ChannelEdgePolicy)
require.True(h.t, ok)

return edgeInfo, policy1, policy2, err
return edgeInfo, policy1, policy2, nil
}

// getTestPubKey returns a valid parsed pub key to be used in our tests.
Expand Down
2 changes: 1 addition & 1 deletion lnrpc/routerrpc/router_server_deprecated.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (s *Server) SendToRoute(ctx context.Context,
Failure: resp.Failure,
}

return legacyResp, err
return legacyResp, nil
}

// QueryProbability returns the current success probability estimate for a
Expand Down
2 changes: 1 addition & 1 deletion routing/missioncontrol_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func serializeResult(rp *paymentResult) ([]byte, []byte, error) {
return nil, nil, err
}

return key, buff.Bytes(), err
return key, buff.Bytes(), nil
}

// deserializeResult deserializes a payment result.
Expand Down
2 changes: 1 addition & 1 deletion routing/pathfind.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ func getOutgoingBalance(node route.Vertex, outgoingChans map[uint64]struct{},
if err != nil {
return 0, 0, err
}
return max, total, err
return max, total, nil

Check failure on line 564 in routing/pathfind.go

View workflow job for this annotation

GitHub Actions / lint code

return with no blank line before (nlreturn)
}

// findPath attempts to find a path from the source node within the ChannelGraph
Expand Down

0 comments on commit ef968ea

Please sign in to comment.