Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(libwaku): allow several multiaddresses for a single peer in store queries #3171

Merged
merged 2 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions library/libwaku.nim
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ proc waku_peer_exchange_request(

proc waku_ping_peer(
ctx: ptr WakuContext,
peerID: cstring,
peerAddr: cstring,
timeoutMs: cuint,
callback: WakuCallBack,
userData: pointer,
Expand All @@ -721,7 +721,7 @@ proc waku_ping_peer(
.sendRequestToWakuThread(
ctx,
RequestType.PING,
PingRequest.createShared(peerID, chronos.milliseconds(timeoutMs)),
PingRequest.createShared(peerAddr, chronos.milliseconds(timeoutMs)),
)
.handleRes(callback, userData)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import std/[json, sugar, options]
import std/[json, sugar, strutils, options]
import chronos, chronicles, results
import
../../../../../waku/factory/waku,
Expand Down Expand Up @@ -125,7 +125,7 @@ proc process(

let storeQueryRequest = JsonStoreQueryRequest.fromJsonNode(jsonContentRes.get())

let peer = peers.parsePeerInfo($self[].peerAddr).valueOr:
let peer = peers.parsePeerInfo(($self[].peerAddr).split(",")).valueOr:
return err("JsonStoreQueryRequest failed to parse peer addr: " & $error)

let queryResponse = (await waku.node.wakuStoreClient.query(storeQueryRequest, peer)).valueOr:
Expand Down
Loading