]> Untitled Git - bdk-cli/commit
refactor: use handle pattern for Kyoto client
authorMshehu5 <musheu@gmail.com>
Sat, 20 Dec 2025 22:53:14 +0000 (23:53 +0100)
committerMshehu5 <musheu@gmail.com>
Mon, 2 Feb 2026 08:37:47 +0000 (09:37 +0100)
commit99b71fdaede31dd89aa10f153294bfb3e90d5e6f
tree2fe0552f73f1fa844b4b58cab96d5827fe6e8671
parentb9cf2acc5f10db46fa30777ff0910b8610a5fc33
refactor: use handle pattern for Kyoto client

Refactor KyotoClient to use a KyotoClientHandle struct instead of
Box<LightClient>. Previously, the Box<LightClient> was consumed
when destructured in sync_kyoto_client, preventing the function
from being called multiple times or borrowed. With the handle
pattern, sync_kyoto_client now takes &mut KyotoClientHandle,
allowing it to be borrowed and reused.

This also allows the node to be started at creation time in
new_blockchain_client rather than during sync, making the client
ready for use immediately after creation.

- Add KyotoClientHandle struct containing requester and
  update_subscriber
- Move node startup and logger spawning to new_blockchain_client
- Update sync_kyoto_client to accept &mut KyotoClientHandle
  instead of consuming Box<LightClient>
src/utils.rs