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:
ffranr
2024-02-26 11:19:38 +00:00
parent 581c16d72f
commit cd566eb097
103 changed files with 426 additions and 390 deletions

View File

@@ -629,7 +629,7 @@ func (a *Agent) openChans(availableFunds btcutil.Amount, numChans uint32,
nodes[nID] = struct{}{}
return nil
}); err != nil {
return fmt.Errorf("unable to get graph nodes: %v", err)
return fmt.Errorf("unable to get graph nodes: %w", err)
}
// Use the heuristic to calculate a score for each node in the
@@ -639,7 +639,7 @@ func (a *Agent) openChans(availableFunds btcutil.Amount, numChans uint32,
a.cfg.Graph, totalChans, chanSize, nodes,
)
if err != nil {
return fmt.Errorf("unable to calculate node scores : %v", err)
return fmt.Errorf("unable to calculate node scores : %w", err)
}
log.Debugf("Got scores for %d nodes", len(scores))