Skip to content

Commit 32042e8

Browse files
TheTechmagedbluhm
authored andcommitted
fix: skip forwarding if unnecessary
Signed-off-by: Colton Wolkins (Indicio work address) <colton@indicio.tech>
1 parent 1ec4c5a commit 32042e8

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

didcomm_messaging/routing.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ async def prepare_forward(
103103
if not chain[-1]["service"]:
104104
raise RoutingServiceError(f"No DIDCommV2 service endpoint found for {to}")
105105

106+
# If we didn't find any services to forward to, just bail
107+
if len(chain) == 1:
108+
return (encoded_message, chain[-1]["service"])
109+
106110
# Grab our target to pack the initial message to, then pack the message
107111
# for the DID target
108112
final_destination = chain.pop(0)

0 commit comments

Comments
 (0)