Skip to content

Commit

Permalink
refactor(libwaku): allow several multiaddresses for a single peer in …
Browse files Browse the repository at this point in the history
…store queries (#3171)

* fix: parameter name
* refactor: allow multiple addresses for a peer in a store query
  • Loading branch information
richard-ramos authored Nov 8, 2024
1 parent 8fde709 commit 3cb8ebd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit 3cb8ebd

Please sign in to comment.