From 4c8e1f0f03a1f21cfd5b7c8dcaa84c894d71dcac Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Thu, 15 Dec 2022 17:12:15 -0400 Subject: [PATCH] fix --- run.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/run.go b/run.go index 97e62b0..6fa0f27 100644 --- a/run.go +++ b/run.go @@ -84,6 +84,7 @@ func queryNode(ctx context.Context, node string, host1 host.Host, contentTopic s hash1, _ := hex.DecodeString("305b9f88bc8f670b57d895b06296a50eef8b69f1576bce7313d61c3fd4adf677") hash2, _ := hex.DecodeString("5336a19ad110eb5efaa39c180881529da490e3cc12b6f634d00a4105ed57da21") + hash3, _ := hex.DecodeString("7554ffbeb8ec0373b165013708214ebda8103c9ff3d1bd676e0c1cd9b1a9571e") info, err := peer.AddrInfoFromP2pAddr(p) if err != nil { @@ -113,18 +114,21 @@ func queryNode(ctx context.Context, node string, host1 host.Host, contentTopic s cnt += len(result.Messages) cursorIterations += 1 - if result.IsComplete() { - break - } + fmt.Println("Cursor has: ", len(result.Messages)) for _, r := range result.Messages { h, _, _ := r.Hash() - if bytes.Equal(h, hash1) || bytes.Equal(h, hash2) { + //fmt.Println(h, hash1, hash2, hash3) + if bytes.Equal(h, hash1) || bytes.Equal(h, hash2) || bytes.Equal(h, hash3) { fmt.Println("FOUND IN", node) break } } + if result.IsComplete() { + break + } + result, err = s1.Next(ctx, result) if err != nil { fmt.Printf("Could not retrieve more results from %s: %s", info.ID, err.Error())