actors: Fix hive-actor-local? to check the hive id, not whether actor exists.
[8sync.git] / 8sync / systems / actors.scm
index 0659eb52c95f45b5323dcf9e44e887a3a02ebc0a..9ba3818b6ff1d6f6e34b0ff33ae65ad8f29ca619 100644 (file)
@@ -538,7 +538,8 @@ more compact following syntax:
 
   (define (call-catching-coroutine thunk)
     (define (call-catching-errors)
-      ;; TODO: maybe parameterize and use maybe-catch-all from agenda.scm
+      ;; TODO: maybe parameterize (or attach to hive) and use
+      ;;   maybe-catch-all from agenda.scm
       ;; @@: Why not just use with-throw-handler and let the catch
       ;;   happen at the agenda?  That's what we used to do, but
       ;;   it ended up with a SIGABRT.  See:
@@ -641,7 +642,7 @@ more compact following syntax:
         (process-remote-message))))
 
 (define-method (hive-actor-local? (hive <hive>) address)
-  (hash-ref (hive-actor-registry hive) address))
+  (equal? (hive-id hive) (address-hive-id address)))
 
 (define-method (hive-register-actor! (hive <hive>) (actor <actor>))
   (hash-set! (hive-actor-registry hive) (actor-id actor) actor))