Commit 0b53a19
refactor: fix warnings in dash spv (#110)
* fix: remove dead code and fix warnings (89% reduction: 76→8 warnings)
This commit addresses dead code warnings and other compiler warnings across
the dash-spv crate, reducing total warnings from 76 to 8 (89% reduction).
## Dead Code Removed:
- client/mod.rs: 12 unused methods (handle_inventory, process_new_headers, etc.)
- client/filter_sync.rs: 1 unused method (find_height_for_block_hash)
- client/message_handler.rs: 1 unused field (filter_processor) + constructor updates
- network/mod.rs: 1 unused field (message_receiver) + constructor updates
- network/multi_peer.rs: 2 unused methods (select_peer, send_to_peer)
- sync/chainlock_validation.rs: 1 unused method (find_chain_lock_quorum)
- sync/filters.rs: 4 unused constants + 3 unused fields + constructor fixes
## Other Fixes:
- Removed 2 unused imports (FilterNotificationSender, BLSPublicKey)
- Fixed private interface: made ChainLockStats public
- Updated method calls and constructors to remove unused parameters
## Files Modified:
- dash-spv/src/client/filter_sync.rs: removed unused method
- dash-spv/src/client/message_handler.rs: removed unused field and import
- dash-spv/src/client/mod.rs: removed 12 unused methods
- dash-spv/src/network/mod.rs: removed unused field
- dash-spv/src/network/multi_peer.rs: removed 2 unused methods
- dash-spv/src/sync/chainlock_validation.rs: removed unused method, fixed visibility
- dash-spv/src/sync/filters.rs: removed unused constants and fields
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: complete dead code cleanup and resolve import warnings (92% reduction: 76→6 warnings)
This commit completes the systematic cleanup of compiler warnings in dash-spv:
### Fixed Issues:
- **Unused imports**: Removed ForkDetectionResult, ReorgManager, ValidationManager
- **Dead code cleanup**: Removed entire SyncStorageAdapter struct and implementation
- **Unused struct fields**: Added #[allow(dead_code)] annotations for RecoveryEvent fields
- **Unused enum variants**: Added #[allow(dead_code)] for ValidationCacheKey::ChainLock
- **Orphaned code**: Cleaned up remaining code fragments from previous method removals
### Files Modified:
- client/mod.rs: Removed duplicate find_height_for_block_hash method
- headers_with_reorg.rs: Major cleanup - removed unused imports, SyncStorageAdapter, tests
- recovery.rs: Added dead_code annotations for unused but intentional fields
- validation.rs: Added dead_code annotation for ChainLock cache key
### Warning Reduction:
- **Before**: 76 warnings (52 deprecated + 24 dead code)
- **After**: 6 warnings (unused variables in stub methods)
- **Improvement**: 92% reduction in compiler warnings
### Remaining Warnings:
- 3 unused parameters in stub methods (intentional - methods kept for interface compatibility)
- 3 unused methods in client and headers modules (future functionality)
The project now builds cleanly with significantly reduced noise from compiler warnings,
making genuine issues more visible to developers.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: more warnings resolved
* refactor: simplify error handling and improve code readability
* chore: run cargo fmt
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 547b356 commit 0b53a19
16 files changed
Lines changed: 94 additions & 1359 deletions
File tree
- dash-spv/src
- client
- network
- sync
- sequential
- dash/src
- sml/masternode_list_engine
- hashes/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
11 | | - | |
| 9 | + | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
17 | | - | |
| 15 | + | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
| |||
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
30 | | - | |
| 28 | + | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| |||
165 | 163 | | |
166 | 164 | | |
167 | 165 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | 166 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | | - | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
| |||
36 | 34 | | |
37 | 35 | | |
38 | 36 | | |
39 | | - | |
40 | 37 | | |
41 | 38 | | |
42 | 39 | | |
| |||
50 | 47 | | |
51 | 48 | | |
52 | 49 | | |
53 | | - | |
54 | 50 | | |
55 | 51 | | |
56 | 52 | | |
| |||
0 commit comments