diff --git a/repeater/main.py b/repeater/main.py index ee663c4..8d12107 100644 --- a/repeater/main.py +++ b/repeater/main.py @@ -850,6 +850,15 @@ class RepeaterDaemon: # its own flood replies to the region the request arrived under. bridge.region_map = self._region_map + # Feed this bridge every pre-dedup copy of a flood reply so its + # return-path teacher can pick the best-received route rather than + # the first-arrived one. The router hands a bridge only the first + # copy (later ones are dropped by the engine's seen-table) and the + # pre-dedup firehose lives on the dispatcher, which the bridge does + # not own -- so the host has to wire it. + if self.dispatcher: + self.dispatcher.add_raw_packet_subscriber(bridge.note_flood_copy) + # Restore persisted state (contacts/channels/messages) from SQLite. # Raises CompanionStateLoadError instead of continuing with an # empty store when persisted rows exist but cannot be loaded. @@ -1088,6 +1097,15 @@ class RepeaterDaemon: # re-scopes its flood replies to the region the request arrived under. bridge.region_map = self._region_map + # Feed this bridge every pre-dedup copy of a flood reply so its + # return-path teacher can pick the best-received route rather than + # the first-arrived one. The router hands a bridge only the first + # copy (later ones are dropped by the engine's seen-table) and the + # pre-dedup firehose lives on the dispatcher, which the bridge does + # not own -- so the host has to wire it. + if self.dispatcher: + self.dispatcher.add_raw_packet_subscriber(bridge.note_flood_copy) + # Restore persisted state; raises CompanionStateLoadError when persisted # rows exist but cannot be loaded (hot-reload callers surface the error). if sqlite_handler: