mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 01:36:24 +01:00
refactor: use a more straightforward return value
Signed-off-by: fuyangpengqi <995764973@qq.com>
This commit is contained in:
parent
8532955b35
commit
150f72414a
6 changed files with 7 additions and 7 deletions
|
@ -3146,7 +3146,7 @@ func (c *OpenChannel) RemoteCommitChainTip() (*CommitDiff, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return cd, err
|
return cd, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnsignedAckedUpdates retrieves the persisted unsigned acked remote log
|
// UnsignedAckedUpdates retrieves the persisted unsigned acked remote log
|
||||||
|
|
|
@ -738,7 +738,7 @@ func serializeNewResult(rp *paymentResultNew) ([]byte, []byte, error) {
|
||||||
return nil, nil, err
|
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
|
// getResultKeyNew returns a byte slice representing a unique key for this
|
||||||
|
|
|
@ -487,7 +487,7 @@ func (h *htlcTimeoutResolver) sweepTimeoutTx() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// resolveSecondLevelTxLegacy sends a second level timeout transaction to the
|
// resolveSecondLevelTxLegacy sends a second level timeout transaction to the
|
||||||
|
@ -593,7 +593,7 @@ func (h *htlcTimeoutResolver) waitForConfirmedSpend(op *wire.OutPoint,
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return spend, err
|
return spend, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop signals the resolver to cancel any current resolution processes, and
|
// Stop signals the resolver to cancel any current resolution processes, and
|
||||||
|
|
|
@ -89,7 +89,7 @@ func (h *hopHintsConfigMock) FetchChannelEdgesByID(chanID uint64) (
|
||||||
policy2, ok := args.Get(2).(*models.ChannelEdgePolicy)
|
policy2, ok := args.Get(2).(*models.ChannelEdgePolicy)
|
||||||
require.True(h.t, ok)
|
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.
|
// getTestPubKey returns a valid parsed pub key to be used in our tests.
|
||||||
|
|
|
@ -118,7 +118,7 @@ func (s *Server) SendToRoute(ctx context.Context,
|
||||||
Failure: resp.Failure,
|
Failure: resp.Failure,
|
||||||
}
|
}
|
||||||
|
|
||||||
return legacyResp, err
|
return legacyResp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryProbability returns the current success probability estimate for a
|
// QueryProbability returns the current success probability estimate for a
|
||||||
|
|
|
@ -186,7 +186,7 @@ func serializeResult(rp *paymentResult) ([]byte, []byte, error) {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return key, buff.Bytes(), err
|
return key, buff.Bytes(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// deserializeResult deserializes a payment result.
|
// deserializeResult deserializes a payment result.
|
||||||
|
|
Loading…
Add table
Reference in a new issue