Skip to content

Commit

Permalink
fix: skip forwarding if unnecessary
Browse files Browse the repository at this point in the history
Signed-off-by: Colton Wolkins (Indicio work address) <[email protected]>
  • Loading branch information
TheTechmage committed Jan 5, 2024
1 parent 1ec4c5a commit 96b4fe6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions didcomm_messaging/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ async def prepare_forward(
if not chain[-1]["service"]:
raise RoutingServiceError(f"No DIDCommV2 service endpoint found for {to}")

# If we didn't find any services to forward to, just bail
if len(chain) == 1:
return (encoded_message, chain[-1]["service"])

# Grab our target to pack the initial message to, then pack the message
# for the DID target
final_destination = chain.pop(0)
Expand Down

0 comments on commit 96b4fe6

Please sign in to comment.