multi: Fix typos [skip ci]

This commit is contained in:
Dimitris Apostolou committed 2022-01-24 12:19:02 +02:00
1 parent f50950640f
commit 530a2059e5
139 files changed
+254 -254

No files matched your search

+2 -2
View File
@@ -339,7 +339,7 @@ func TestAgentHeuristicUpdateSignal(t *testing.T) {
// initial check.
respondMoreChans(t, testCtx, moreChansResp{0, 0})
// Next we'll signal that one of the heuristcs have been updated.
// Next we'll signal that one of the heuristics have been updated.
testCtx.agent.OnHeuristicUpdate(testCtx.heuristic)
// The update should trigger the agent to ask for a channel budget.so
@@ -1256,7 +1256,7 @@ func TestAgentChannelSizeAllocation(t *testing.T) {
"had %v", len(arg.chans))
}
if arg.balance != testCtx.walletBalance {
t.Fatalf("expectd agent to have %v balance, had %v",
t.Fatalf("expected agent to have %v balance, had %v",
testCtx.walletBalance, arg.balance)
}
case <-time.After(time.Second * 3):
+3 -3
View File
@@ -51,7 +51,7 @@ func (q *queue) empty() bool {
// BetweennessCentrality is a NodeMetric that calculates node betweenness
// centrality using Brandes' algorithm. Betweenness centrality for each node
// is the number of shortest paths passing trough that node, not counting
// is the number of shortest paths passing through that node, not counting
// shortest paths starting or ending at that node. This is a useful metric
// to measure control of individual nodes over the whole network.
type BetweennessCentrality struct {
@@ -167,7 +167,7 @@ func betweennessCentrality(g *SimpleGraph, s int, centrality []float64) {
}
}
// Refresh recaculates and stores centrality values.
// Refresh recalculates and stores centrality values.
func (bc *BetweennessCentrality) Refresh(graph ChannelGraph) error {
cache, err := NewSimpleGraph(graph)
if err != nil {
@@ -186,7 +186,7 @@ func (bc *BetweennessCentrality) Refresh(graph ChannelGraph) error {
partial := make([]float64, len(cache.Nodes))
// Consume the next node, update centrality
// parital to avoid unnecessary synchronizaton.
// parital to avoid unnecessary synchronization.
for node := range work {
betweennessCentrality(cache, node, partial)
}
+1 -1
View File
@@ -35,7 +35,7 @@ var normalizedTestGraphCentrality = []float64{
0.2, 0.0, 0.2, 1.0, 0.4, 0.4, 7.0 / 15.0, 0.0, 0.0,
}
// buildTestGraph builds a test graph from a passed graph desriptor.
// buildTestGraph builds a test graph from a passed graph descriptor.
func buildTestGraph(t *testing.T,
graph testGraph, desc testGraphDesc) map[int]*btcec.PublicKey {
+2 -2
View File
@@ -11,7 +11,7 @@ import (
var ErrNoPositive = errors.New("no positive weights left")
// weightedChoice draws a random index from the slice of weights, with a
// probability propotional to the weight at the given index.
// probability proportional to the weight at the given index.
func weightedChoice(w []float64) (int, error) {
// Calculate the sum of weights.
var sum float64
@@ -25,7 +25,7 @@ func weightedChoice(w []float64) (int, error) {
// Pick a random number in the range [0.0, 1.0) and multiply it with
// the sum of weights. Then we'll iterate the weights until the number
// goes below 0. This means that each index is picked with a probablity
// goes below 0. This means that each index is picked with a probability
// equal to their normalized score.
//
// Example:
+1 -1
View File
@@ -92,7 +92,7 @@ func (c *WeightedCombAttachment) NodeScores(g ChannelGraph, chans []LocalChannel
}
// We combine the scores given by the sub-heuristics by using the
// heruistics' given weight factor.
// heuristics' given weight factor.
scores := make(map[NodeID]*NodeScore)
for nID := range nodes {
score := &NodeScore{