Skip to content

Commit

Permalink
Fix: check to ensure origin is not OnChain
Browse files Browse the repository at this point in the history
  • Loading branch information
1yam committed Jan 13, 2025
1 parent 3e9a6d2 commit 7028c76
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/aleph/handlers/message_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,10 @@ def __init__(
async def _publish_pending_message(self, pending_message: PendingMessageDb) -> None:
mq_message = aio_pika.Message(body=f"{pending_message.id}".encode("utf-8"))
process_or_fetch = "process" if pending_message.fetched else "fetch"
await self.pending_message_exchange.publish(
mq_message, routing_key=f"{process_or_fetch}.{pending_message.item_hash}"
)
if pending_message.origin != MessageOrigin.ONCHAIN:
await self.pending_message_exchange.publish(
mq_message, routing_key=f"{process_or_fetch}.{pending_message.item_hash}"
)

async def add_pending_message(
self,
Expand Down Expand Up @@ -220,6 +221,7 @@ async def add_pending_message(
reception_time=reception_time,
tx_hash=tx_hash,
check_message=check_message,
origin=origin,
)

try:
Expand Down

0 comments on commit 7028c76

Please sign in to comment.