2222 "(?m)(?s)ID: ([0-9a-f]{66})\n Contact: (.*?)\n Time: " ,
2323 )
2424
25- ambossQueryDelay = 7 * time .Second
25+ ambossQueryDelay = 4 * time .Second
2626
2727 initialTemplate = `SEND TO: {{.Contact}}
2828
@@ -134,8 +134,7 @@ This command will be run by guggero and the result will be sent to the
134134registered nodes.` ,
135135 Example : `chantools zombierecovery findmatches \
136136 --registrations data.txt \
137- --channel_graph lncli_describegraph.json \
138- --pairs_done pairs-done.json` ,
137+ --ambosskey <API key>` ,
139138 RunE : cc .Execute ,
140139 }
141140
@@ -332,10 +331,12 @@ func (c *zombieRecoveryFindMatchesCommand) Execute(_ *cobra.Command,
332331func fetchChannels (client * graphql.Client , pubkey string ) ([]* gqChannel ,
333332 error ) {
334333
334+ offset := 0.0
335+ limit := 50.0
335336 variables := map [string ]interface {}{
336337 "pubkey" : pubkey ,
337338 "limit" : 50.0 ,
338- "offset" : 0.0 ,
339+ "offset" : offset ,
339340 }
340341
341342 var channels []* gqChannel
@@ -346,16 +347,15 @@ func fetchChannels(client *graphql.Client, pubkey string) ([]*gqChannel,
346347 return nil , err
347348 }
348349
349- if len (query .GetNode .GraphInfo .Channels .ChannelList .List ) == 0 {
350+ channelList := query .GetNode .GraphInfo .Channels .ChannelList
351+ channels = append (channels , channelList .List ... )
352+
353+ if len (channelList .List ) < int (limit ) {
350354 break
351355 }
352356
353- channels = append (
354- channels ,
355- query .GetNode .GraphInfo .Channels .ChannelList .List ... ,
356- )
357-
358- variables ["offset" ] = variables ["offset" ].(float64 ) + 50.0
357+ offset += 50.0
358+ variables ["offset" ] = offset
359359 }
360360
361361 return channels , nil
0 commit comments