-
Notifications
You must be signed in to change notification settings - Fork 9
suggestion(dash-spv-ffi): unused ffi functions removed from dash-spv-ffi crate #377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -74,12 +74,6 @@ fn main() { | |||||||||||||||||||||||||||||||||
| .action(ArgAction::Append) | ||||||||||||||||||||||||||||||||||
| .help("Peer address host:port (repeatable)"), | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
| .arg( | ||||||||||||||||||||||||||||||||||
| Arg::new("workers") | ||||||||||||||||||||||||||||||||||
| .long("workers") | ||||||||||||||||||||||||||||||||||
| .value_parser(clap::value_parser!(u32)) | ||||||||||||||||||||||||||||||||||
| .help("Tokio worker threads (0=auto)"), | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
| .arg( | ||||||||||||||||||||||||||||||||||
| Arg::new("log-level") | ||||||||||||||||||||||||||||||||||
| .long("log-level") | ||||||||||||||||||||||||||||||||||
|
|
@@ -99,12 +93,6 @@ fn main() { | |||||||||||||||||||||||||||||||||
| .action(ArgAction::SetTrue) | ||||||||||||||||||||||||||||||||||
| .help("Disable masternode list synchronization"), | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
| .arg( | ||||||||||||||||||||||||||||||||||
| Arg::new("no-filters") | ||||||||||||||||||||||||||||||||||
| .long("no-filters") | ||||||||||||||||||||||||||||||||||
| .action(ArgAction::SetTrue) | ||||||||||||||||||||||||||||||||||
| .help("Disable compact filter synchronization"), | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
| .get_matches(); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| // Map network | ||||||||||||||||||||||||||||||||||
|
|
@@ -115,8 +103,6 @@ fn main() { | |||||||||||||||||||||||||||||||||
| _ => FFINetwork::Dash, | ||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| let disable_filter_sync = matches.get_flag("no-filters"); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| unsafe { | ||||||||||||||||||||||||||||||||||
| // Initialize tracing/logging via FFI so `tracing::info!` emits output | ||||||||||||||||||||||||||||||||||
| let level = matches.get_one::<String>("log-level").map(String::as_str).unwrap_or("info"); | ||||||||||||||||||||||||||||||||||
|
|
@@ -133,12 +119,6 @@ fn main() { | |||||||||||||||||||||||||||||||||
| std::process::exit(1); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| let _ = dash_spv_ffi_config_set_filter_load(cfg, !disable_filter_sync); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| if let Some(workers) = matches.get_one::<u32>("workers") { | ||||||||||||||||||||||||||||||||||
| let _ = dash_spv_ffi_config_set_worker_threads(cfg, *workers); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| if let Some(height) = matches.get_one::<u32>("start-height") { | ||||||||||||||||||||||||||||||||||
| let _ = dash_spv_ffi_config_set_start_from_height(cfg, *height); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
@@ -214,13 +194,9 @@ fn main() { | |||||||||||||||||||||||||||||||||
| if !prog_ptr.is_null() { | ||||||||||||||||||||||||||||||||||
| let prog = &*prog_ptr; | ||||||||||||||||||||||||||||||||||
| let headers_done = SYNC_COMPLETED.load(Ordering::SeqCst); | ||||||||||||||||||||||||||||||||||
| let filters_complete = if disable_filter_sync || !prog.filter_sync_available { | ||||||||||||||||||||||||||||||||||
| false | ||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||
| prog.filter_header_height >= prog.header_height | ||||||||||||||||||||||||||||||||||
| && prog.last_synced_filter_height >= prog.filter_header_height | ||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||
| if headers_done && (filters_complete || disable_filter_sync) { | ||||||||||||||||||||||||||||||||||
| let filters_complete = prog.filter_header_height >= prog.header_height | ||||||||||||||||||||||||||||||||||
| && prog.last_synced_filter_height >= prog.filter_header_height; | ||||||||||||||||||||||||||||||||||
| if headers_done && filters_complete { | ||||||||||||||||||||||||||||||||||
|
Comment on lines
196
to
+199
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prevent a potential hang when filter sync is unavailable. If 🐛 Proposed fix- let filters_complete = prog.filter_header_height >= prog.header_height
- && prog.last_synced_filter_height >= prog.filter_header_height;
+ let filters_complete = !prog.filter_sync_available
+ || (prog.filter_header_height >= prog.header_height
+ && prog.last_synced_filter_height >= prog.filter_header_height);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| dash_spv_ffi_sync_progress_destroy(prog_ptr); | ||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you want to remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the ffi function that enables/disables the filters since its not being used in iOS. removed this bcs it is something you can no longer configure using ffi