mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-28 02:33:10 +00:00
minor refactor, remove unnecessary log lines
This commit is contained in:
parent
ef4ec24b85
commit
bc73b71ff0
@ -249,13 +249,6 @@ proc selectPeer*(
|
||||
var preSelectedPeers =
|
||||
if pm.reputationManager.isSome():
|
||||
debug "Reputation enabled: consider only non-negative reputation peers"
|
||||
# FIXME: remove double loop
|
||||
for peer in peers:
|
||||
let rep = try:
|
||||
pm.reputationManager.get().getReputation(peer.peerId)
|
||||
except KeyError:
|
||||
none(bool)
|
||||
debug "Peer with reputation:", peer=peer, reputation=rep
|
||||
peers.filterIt:
|
||||
let rep =
|
||||
try:
|
||||
|
||||
@ -1229,9 +1229,6 @@ proc lightpushPublish*(
|
||||
error "lightpush publish error", error = msg
|
||||
return lighpushErrorResult(LightPushErrorCode.INTERNAL_SERVER_ERROR, msg)
|
||||
|
||||
debug "in lightpushPublish"
|
||||
debug "eligibilityProof: ", eligibilityProof
|
||||
|
||||
return await lightpushPublishHandler(node, pubsubForPublish, message, eligibilityProof, toPeer)
|
||||
|
||||
## Waku RLN Relay
|
||||
|
||||
@ -94,9 +94,7 @@ proc installLightPushRequestHandler*(
|
||||
makeRestResponse(lightpushResultServiceUnavailable(NoPeerNoneFoundError))
|
||||
toPeer = some(aPeer)
|
||||
|
||||
debug "in installLightPushRequestHandler"
|
||||
debug "request:", req
|
||||
debug "request.eligibilityProof:", eligibilityProof = req.eligibilityProof
|
||||
debug "Handling Lightpush request:", req
|
||||
|
||||
let subFut = node.lightpushPublish(req.pubsubTopic, msg, req.eligibilityProof, toPeer)
|
||||
|
||||
|
||||
@ -86,21 +86,18 @@ proc publish*(
|
||||
if message.timestamp == 0:
|
||||
message.timestamp = getNowInNanosecondTime()
|
||||
|
||||
# FIXME: make more DRY
|
||||
when peer is PeerId:
|
||||
info "publish",
|
||||
peerId = shortLog(peer),
|
||||
msg_hash = computeMessageHash(pubsubTopic.get(""), message).to0xHex
|
||||
else:
|
||||
info "publish",
|
||||
peerId = shortLog(peer.peerId),
|
||||
msg_hash = computeMessageHash(pubsubTopic.get(""), message).to0xHex
|
||||
info "publish",
|
||||
peerId = shortLog(
|
||||
when peer is PeerId: peer
|
||||
else: peer.peerId
|
||||
),
|
||||
msg_hash = computeMessageHash(pubSubTopic.get(""), message).to0xHex
|
||||
|
||||
# i13n POC: adding eligibilityProof to the request
|
||||
# i13n POC: add eligibilityProof to the request
|
||||
let pushRequest = LightpushRequest(
|
||||
requestId: generateRequestId(wl.rng), pubSubTopic: pubSubTopic, message: message, eligibilityProof: eligibilityProof
|
||||
)
|
||||
debug "in Lightpush client publish: created pushRequest: ", pushRequest
|
||||
debug "Created Lightpush request: ", pushRequest
|
||||
let publishedCount = ?await wl.sendPushRequest(pushRequest, peer)
|
||||
|
||||
for obs in wl.publishObservers:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user