         storage {:hash valuehash :value canonvalue :parent oldmaster}
         masterhash (sha256 (str valuehash oldmaster))
         ]
-    (log/debugf "Adding '%s' resulting in new masterhash %s" value masterhash)
+    (log/debugf "%s: Adding '%s' resulting in new masterhash %s" (dbid db) value masterhash)
     (level/put (getdb db)
                masterhash (tostr storage)
                master masterhash)

)

(defn send-to-node [db dest msgtype msg]
  (log/infof "Sending %s %s" dest msgtype)
  ((:send-to-node db) dest (assoc msg :sender (dbid db) :msgtype msgtype))
)

(defn send-to-client [db dest action data]
  (log/infof "Sending %s %s" dest action data)
  ((:send-to-client db) dest {:action action :data data})
)


                )))
          )
        )
        (log/errorf "%s: Can't find master %s" (dbid db) (:master msg))
      )
    (log/errorf "Unknown message type: %s %s" (:msgtype msg) msg)
  )
