You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
merge FFI callback setup into dash_spv_ffi_client_run
Pass all event callbacks as a single `FFIEventCallbacks` struct directly
to `run()` instead of requiring separate set_*_callbacks() calls. This
removes 5 Mutex fields from `FFIDashSpvClient` and 10 FFI functions.
Set sync event callbacks for push-based event notifications. Call this before calling run(). The callbacks are snapshotted when `dash_spv_ffi_client_run` is called. # Safety - `client` must be a valid, non-null pointer to an `FFIDashSpvClient`. - The `callbacks` struct and its `user_data` must remain valid until callbacks are cleared. - Callbacks must be thread-safe as they may be called from a background task.
485
-
486
-
**Safety:**
487
-
-`client` must be a valid, non-null pointer to an `FFIDashSpvClient`. - The `callbacks` struct and its `user_data` must remain valid until callbacks are cleared. - Callbacks must be thread-safe as they may be called from a background task.
488
-
489
-
**Module:**`client`
490
-
491
-
---
492
-
493
435
#### `dash_spv_ffi_sync_progress_destroy`
494
436
495
437
```c
@@ -506,40 +448,6 @@ Destroy an `FFISyncProgress` object and all its nested pointers. # Safety - `pr
Set wallet event callbacks for push-based event notifications. Call this before calling run(). The callbacks are snapshotted when `dash_spv_ffi_client_run` is called. # Safety - `client` must be a valid, non-null pointer to an `FFIDashSpvClient`. - The `callbacks` struct and its `user_data` must remain valid until callbacks are cleared. - Callbacks must be thread-safe as they may be called from a background task.
535
-
536
-
**Safety:**
537
-
- `client` must be a valid, non-null pointer to an `FFIDashSpvClient`. - The `callbacks` struct and its `user_data` must remain valid until callbacks are cleared. - Callbacks must be thread-safe as they may be called from a background task.
538
-
539
-
**Module:** `client`
540
-
541
-
---
542
-
543
451
### Transaction Management - Detailed
544
452
545
453
#### `dash_spv_ffi_client_broadcast_transaction`
@@ -592,104 +500,6 @@ This function is unsafe because: - The caller must ensure all pointers are valid
Set a callback for fatal client errors (start failure, sync thread crash). # Safety - `client` must be a valid, non-null pointer to an `FFIDashSpvClient`. - The `callback` struct and its `user_data` must remain valid until the callback is cleared. - The callback must be thread-safe as it may be called from a background thread.
653
-
654
-
**Safety:**
655
-
-`client` must be a valid, non-null pointer to an `FFIDashSpvClient`. - The `callback` struct and its `user_data` must remain valid until the callback is cleared. - The callback must be thread-safe as it may be called from a background thread.
Set network event callbacks for push-based event notifications. Call this before calling run(). The callbacks are snapshotted when `dash_spv_ffi_client_run` is called. # Safety - `client` must be a valid, non-null pointer to an `FFIDashSpvClient`. - The `callbacks` struct and its `user_data` must remain valid until callbacks are cleared. - Callbacks must be thread-safe as they may be called from a background task.
669
-
670
-
**Safety:**
671
-
- `client` must be a valid, non-null pointer to an `FFIDashSpvClient`. - The `callbacks` struct and its `user_data` must remain valid until callbacks are cleared. - Callbacks must be thread-safe as they may be called from a background task.
Set progress callback for sync progress updates. Call this before calling run(). The callback is snapshotted when `dash_spv_ffi_client_run` is called. # Safety - `client` must be a valid, non-null pointer to an `FFIDashSpvClient`. - The `callback` struct and its `user_data` must remain valid until the callback is cleared. - The callback must be thread-safe as it may be called from a background task.
685
-
686
-
**Safety:**
687
-
-`client` must be a valid, non-null pointer to an `FFIDashSpvClient`. - The `callback` struct and its `user_data` must remain valid until the callback is cleared. - The callback must be thread-safe as it may be called from a background task.
688
-
689
-
**Module:**`client`
690
-
691
-
---
692
-
693
503
### Error Handling - Detailed
694
504
695
505
#### `dash_spv_ffi_get_last_error`
@@ -787,14 +597,14 @@ The caller must ensure that: - The client pointer is valid - The returned pointe
Start the SPV client and begin syncing in the background. Creates an event handler from the currently configured callbacks and passes it to the library's `run()` method, which manages all channel subscriptions and monitoring tasks internally. Returns immediately after spawning. Configure callbacks before calling `run()` via `set_sync_event_callbacks`, `set_network_event_callbacks`, `set_wallet_event_callbacks`, etc. # Safety - `client` must be a valid, non-null pointer to a created client. # Returns 0 on success, error code on failure.
604
+
Start the SPV client and begin syncing in the background. Accepts all event callbacks as a single struct and passes them to the library's `run()` method, which manages channel subscriptions and monitoring tasks internally. Returns immediately after spawning. # Safety - `client` must be a valid, non-null pointer to a created client. - The `callbacks` struct and its `user_data` pointers must remain valid until `dash_spv_ffi_client_stop` or `dash_spv_ffi_client_destroy` is called. # Returns 0 on success, error code on failure.
795
605
796
606
**Safety:**
797
-
-`client` must be a valid, non-null pointer to a created client.
607
+
-`client` must be a valid, non-null pointer to a created client. - The `callbacks` struct and its `user_data` pointers must remain valid until `dash_spv_ffi_client_stop` or `dash_spv_ffi_client_destroy` is called.
0 commit comments