multi: fix fmt.Errorf error wrapping
Refactor fmt.Errorf usage to correctly wrap errors instead of using non-wrapping format verbs.
This commit is contained in:
103 files changed
+426
-390
No files matched your search
@@ -1659,7 +1659,7 @@ func (d *AuthenticatedGossiper) retransmitStaleAnns(now time.Time) error {
|
||||
chanToUpdate.info, chanToUpdate.edge,
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to update channel: %v", err)
|
||||
return fmt.Errorf("unable to update channel: %w", err)
|
||||
}
|
||||
|
||||
// If we have a valid announcement to transmit, then we'll send
|
||||
@@ -1715,7 +1715,7 @@ func (d *AuthenticatedGossiper) retransmitStaleAnns(now time.Time) error {
|
||||
// With all the wire announcements properly crafted, we'll broadcast
|
||||
// our known outgoing channels to all our immediate peers.
|
||||
if err := d.cfg.Broadcast(nil, signedUpdates...); err != nil {
|
||||
return fmt.Errorf("unable to re-broadcast channels: %v", err)
|
||||
return fmt.Errorf("unable to re-broadcast channels: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
@@ -806,7 +806,7 @@ func createTestCtx(t *testing.T, startHeight uint32) (*testCtx, error) {
|
||||
}, selfKeyDesc)
|
||||
|
||||
if err := gossiper.Start(); err != nil {
|
||||
return nil, fmt.Errorf("unable to start router: %v", err)
|
||||
return nil, fmt.Errorf("unable to start router: %w", err)
|
||||
}
|
||||
|
||||
// Mark the graph as synced in order to allow the announcements to be
|
||||
|
||||
+3
-2
@@ -904,7 +904,7 @@ func (g *GossipSyncer) processChanRangeReply(msg *lnwire.ReplyChannelRange) erro
|
||||
g.cfg.isStillZombieChannel,
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to filter chan ids: %v", err)
|
||||
return fmt.Errorf("unable to filter chan ids: %w", err)
|
||||
}
|
||||
|
||||
// As we've received the entirety of the reply, we no longer need to
|
||||
@@ -1599,7 +1599,8 @@ func (g *GossipSyncer) handleSyncTransition(req *syncTransitionReq) error {
|
||||
|
||||
err := g.sendGossipTimestampRange(firstTimestamp, timestampRange)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to send local update horizon: %v", err)
|
||||
return fmt.Errorf("unable to send local update horizon: %w",
|
||||
err)
|
||||
}
|
||||
|
||||
g.setSyncType(req.newSyncType)
|
||||
|
||||
@@ -1045,7 +1045,8 @@ func TestGossipSyncerReplyChanRangeQueryBlockRange(t *testing.T) {
|
||||
go func() {
|
||||
for _, query := range queryReqs {
|
||||
if err := syncer.replyChanRangeQuery(query); err != nil {
|
||||
errCh <- fmt.Errorf("unable to issue query: %v", err)
|
||||
errCh <- fmt.Errorf("unable to issue query: %w",
|
||||
err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user