Merge pull request #3367 from cfromknecht/batched-graph-updates

Batched graph updates
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2020-11-25 18:40:40 -08:00
commit 7e298f1434
14 files changed
+547 -81

No files matched your search

+24 -19
View File
@@ -1850,31 +1850,36 @@ func getChannelPolicies(t *harnessTest, node *lntest.HarnessNode,
}
ctxt, _ := context.WithTimeout(ctxb, defaultTimeout)
chanGraph, err := node.DescribeGraph(ctxt, descReq)
if err != nil {
t.Fatalf("unable to query for alice's graph: %v", err)
}
require.NoError(t.t, err, "unable to query for alice's graph")
var policies []*lnrpc.RoutingPolicy
out:
for _, chanPoint := range chanPoints {
for _, e := range chanGraph.Edges {
if e.ChanPoint != txStr(chanPoint) {
continue
err = wait.NoError(func() error {
out:
for _, chanPoint := range chanPoints {
for _, e := range chanGraph.Edges {
if e.ChanPoint != txStr(chanPoint) {
continue
}
if e.Node1Pub == advertisingNode {
policies = append(policies,
e.Node1Policy)
} else {
policies = append(policies,
e.Node2Policy)
}
continue out
}
if e.Node1Pub == advertisingNode {
policies = append(policies, e.Node1Policy)
} else {
policies = append(policies, e.Node2Policy)
}
continue out
// If we've iterated over all the known edges and we weren't
// able to find this specific one, then we'll fail.
return fmt.Errorf("did not find edge %v", txStr(chanPoint))
}
// If we've iterated over all the known edges and we weren't
// able to find this specific one, then we'll fail.
t.Fatalf("did not find edge %v", txStr(chanPoint))
}
return nil
}, defaultTimeout)
require.NoError(t.t, err)
return policies
}
+1
View File
@@ -238,6 +238,7 @@ func (cfg NodeConfig) genArgs() []string {
args = append(args, "--nobootstrap")
args = append(args, "--debuglevel=debug")
args = append(args, "--bitcoin.defaultchanconfs=1")
args = append(args, fmt.Sprintf("--db.batch-commit-interval=%v", 10*time.Millisecond))
args = append(args, fmt.Sprintf("--bitcoin.defaultremotedelay=%v", DefaultCSV))
args = append(args, fmt.Sprintf("--rpclisten=%v", cfg.RPCAddr()))
args = append(args, fmt.Sprintf("--restlisten=%v", cfg.RESTAddr()))