Split chainparams.cpp and rpcwallet.cpp into smaller files

chainparams.cpp: 5420 -> 593 lines
  - Extract HUSH3 checkpoint data to chainparams_checkpoints_hush3.h
  - Extract DRAGONX checkpoint data to chainparams_checkpoints_dragonx.h

rpcwallet.cpp: 6392 -> 4099 lines
  - Extract z-index query RPCs to rpcwallet_zindex.cpp
  - Extract shielded async operation RPCs to rpcwallet_zops.cpp
  - Create rpcwallet_internal.h for shared declarations
This commit is contained in:
dan_s
2026-02-26 22:32:24 -06:00
parent 3d4e25e429
commit a918136a7c
9 changed files with 7288 additions and 7127 deletions

View File

@@ -36,8 +36,15 @@ Several files are extremely large and would benefit from decomposition:
| `src/wallet/wallet.cpp` | 5,059 | Split wallet transaction logic from key management |
- [ ] Split `src/main.cpp`
- [ ] Split `src/wallet/rpcwallet.cpp`
- [ ] Split `src/chainparams.cpp`
- [x] Split `src/wallet/rpcwallet.cpp`
- 6,392 → 4,099 lines in `rpcwallet.cpp`
- Created `wallet/rpcwallet_zindex.cpp` (1,193 lines) — z-index query RPCs (`getalldata`, `z_getinfo`, `z_getstats`, etc.)
- Created `wallet/rpcwallet_zops.cpp` (1,194 lines) — shielded async operation RPCs (`z_sendmany`, `z_shieldcoinbase`, `z_mergetoaddress`, etc.)
- Created `wallet/rpcwallet_internal.h` (45 lines) — shared declarations and `THROW_IF_SYNCING` macro
- [x] Split `src/chainparams.cpp`
- 5,420 → 593 lines in `chainparams.cpp`
- Created `chainparams_checkpoints_hush3.h` (1,986 lines) — HUSH3 checkpoint data
- Created `chainparams_checkpoints_dragonx.h` (2,853 lines) — DRAGONX checkpoint data
- [ ] Split `src/wallet/wallet.cpp`
## 5. Move Implementation Out of Header Files
@@ -120,4 +127,4 @@ Docs are split across `doc/`, `contrib/README.md`, and the root.
4. Item **5** — move implementation out of headers
5. Item **4** — split monolithic source files
6. Item **6** — deduplicate cJSON
7. Item **2**move params to LFS or download script
7. Item **2**Move shell scripts to `contrib/scripts/` directory