Skip to content

Commit 6b80796

Browse files
authored
Merge pull request #9936 from ellemouton/graphSQL12
[12] graph/db: Implement more graph SQLStore methods
2 parents a9b530c + 3687171 commit 6b80796

File tree

9 files changed

+1122
-15
lines changed

9 files changed

+1122
-15
lines changed

docs/release-notes/release-notes-0.20.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ circuit. The indices are only available for forwarding events saved after v0.20.
8585
* [3](https://github.com/lightningnetwork/lnd/pull/9887)
8686
* [4](https://github.com/lightningnetwork/lnd/pull/9931)
8787
* [5](https://github.com/lightningnetwork/lnd/pull/9935)
88+
* [6](https://github.com/lightningnetwork/lnd/pull/9936)
8889

8990
## RPC Updates
9091

graph/db/graph_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,7 @@ func TestForEachSourceNodeChannel(t *testing.T) {
12771277
func TestGraphTraversal(t *testing.T) {
12781278
t.Parallel()
12791279

1280-
graph := MakeTestGraph(t)
1280+
graph := MakeTestGraphNew(t)
12811281

12821282
// We'd like to test some of the graph traversal capabilities within
12831283
// the DB, so we'll create a series of fake nodes to insert into the
@@ -1937,7 +1937,7 @@ func TestChanUpdatesInHorizon(t *testing.T) {
19371937
t.Parallel()
19381938
ctx := context.Background()
19391939

1940-
graph := MakeTestGraph(t)
1940+
graph := MakeTestGraphNew(t)
19411941

19421942
// If we issue an arbitrary query before any channel updates are
19431943
// inserted in the database, we should get zero results.
@@ -2727,7 +2727,7 @@ func TestFilterChannelRange(t *testing.T) {
27272727
t.Parallel()
27282728
ctx := context.Background()
27292729

2730-
graph := MakeTestGraph(t)
2730+
graph := MakeTestGraphNew(t)
27312731

27322732
// We'll first populate our graph with two nodes. All channels created
27332733
// below will be made between these two nodes.

graph/db/kv_store.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2149,9 +2149,14 @@ func (c *KVStore) ChanUpdatesInHorizon(startTime,
21492149
c.chanCache.insert(chanid, channel)
21502150
}
21512151

2152-
log.Debugf("ChanUpdatesInHorizon hit percentage: %f (%d/%d)",
2153-
float64(hits)/float64(len(edgesInHorizon)), hits,
2154-
len(edgesInHorizon))
2152+
if len(edgesInHorizon) > 0 {
2153+
log.Debugf("ChanUpdatesInHorizon hit percentage: %f (%d/%d)",
2154+
float64(hits)/float64(len(edgesInHorizon)), hits,
2155+
len(edgesInHorizon))
2156+
} else {
2157+
log.Debugf("ChanUpdatesInHorizon returned no edges in "+
2158+
"horizon (%s, %s)", startTime, endTime)
2159+
}
21552160

21562161
return edgesInHorizon, nil
21572162
}

0 commit comments

Comments
 (0)