mirror of https://github.com/waku-org/nwaku.git
refactor(libwaku): allow several multiaddresses for a single peer in store queries (#3171)
* fix: parameter name * refactor: allow multiple addresses for a peer in a store query
This commit is contained in:
parent
8fde70937d
commit
3cb8ebdd8f
|
@ -710,7 +710,7 @@ proc waku_peer_exchange_request(
|
||||||
|
|
||||||
proc waku_ping_peer(
|
proc waku_ping_peer(
|
||||||
ctx: ptr WakuContext,
|
ctx: ptr WakuContext,
|
||||||
peerID: cstring,
|
peerAddr: cstring,
|
||||||
timeoutMs: cuint,
|
timeoutMs: cuint,
|
||||||
callback: WakuCallBack,
|
callback: WakuCallBack,
|
||||||
userData: pointer,
|
userData: pointer,
|
||||||
|
@ -721,7 +721,7 @@ proc waku_ping_peer(
|
||||||
.sendRequestToWakuThread(
|
.sendRequestToWakuThread(
|
||||||
ctx,
|
ctx,
|
||||||
RequestType.PING,
|
RequestType.PING,
|
||||||
PingRequest.createShared(peerID, chronos.milliseconds(timeoutMs)),
|
PingRequest.createShared(peerAddr, chronos.milliseconds(timeoutMs)),
|
||||||
)
|
)
|
||||||
.handleRes(callback, userData)
|
.handleRes(callback, userData)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import std/[json, sugar, options]
|
import std/[json, sugar, strutils, options]
|
||||||
import chronos, chronicles, results
|
import chronos, chronicles, results
|
||||||
import
|
import
|
||||||
../../../../../waku/factory/waku,
|
../../../../../waku/factory/waku,
|
||||||
|
@ -125,7 +125,7 @@ proc process(
|
||||||
|
|
||||||
let storeQueryRequest = JsonStoreQueryRequest.fromJsonNode(jsonContentRes.get())
|
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)
|
return err("JsonStoreQueryRequest failed to parse peer addr: " & $error)
|
||||||
|
|
||||||
let queryResponse = (await waku.node.wakuStoreClient.query(storeQueryRequest, peer)).valueOr:
|
let queryResponse = (await waku.node.wakuStoreClient.query(storeQueryRequest, peer)).valueOr:
|
||||||
|
|
Loading…
Reference in New Issue