Skip to content

Commit

Permalink
Changing computation outside of log
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmer committed Jan 25, 2024
1 parent 02364ac commit e80cd8b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion waku/waku_archive/archive.nim
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,12 @@ proc handleMessage*(w: WakuArchive,
let
msgDigest = computeDigest(msg)
msgHash = computeMessageHash(pubsubTopic, msg)
msgDigestHex = toHex(msgDigest.data)
msgHashHex = toHex(msgHash)
msgReceivedTime = if msg.timestamp > 0: msg.timestamp
else: getNanosecondTime(getTime().toUnixFloat())

trace "handling message", pubsubTopic=pubsubTopic, contentTopic=msg.contentTopic, timestamp=msg.timestamp, digest=toHex(msgDigest.data), messageHash=toHex(msgHash)
trace "handling message", pubsubTopic=pubsubTopic, contentTopic=msg.contentTopic, timestamp=msg.timestamp, digest=msgDigestHex, messageHash=msgHashHex

let putRes = await w.driver.put(pubsubTopic, msg, msgDigest, msgHash, msgReceivedTime)
if putRes.isErr():
Expand Down

0 comments on commit e80cd8b

Please sign in to comment.