5 Commits

Author SHA1 Message Date
dan_s
a2647b106f Move 15 loose scripts from contrib/ root to contrib/scripts/
Consolidate all standalone utility scripts into contrib/scripts/:
- Perl: avg_blocktime.pl, block_time.pl, gen-zaddrs.pl, sda_checkpoints.pl,
  sdl_checkpoints.pl, hush_block_subsidy_per_halving, hush_halvings,
  hush_scanner, hush_supply, hush_supply_old
- Shell: fresh_clone_compile_and_run.sh, tidy_datadir.sh, dragonx_scanner
- Python: convert_address.py
- BAT: hush-uri.bat

Update path references in contrib/README.md, doc/OLD_WALLETS.md,
doc/relnotes/README.md, and sdl_checkpoints.pl.
2026-02-27 12:00:46 -06:00
dan_s
ab6a3a05d7 Deduplicate cJSON: consolidate 4 copies into a single canonical pair
- Compile cJSON.c as a standalone C translation unit (added stdbool.h)
- Rename hush_cJSON.c → hush_cJSON.cpp and compile as standalone C++ unit
  with forward declarations for external deps (_stripwhite, clonestr, etc.)
- Remove #include "cJSON.c" unity-build from hush_cJSON
- Change hush.h from #include "hush_cJSON.c" to #include "hush_cJSON.h"
- Add both files to libbitcoin_server_a_SOURCES in Makefile.am
- Delete cc/dapps/cJSON.c (old 2009 fork, 1201 lines removed)
- Replace cc/includes/cJSON.h with thin redirect to canonical headers
- Update dapp includes to reference canonical cJSON.c
2026-02-27 09:39:48 -06:00
dan_s
f565b2920d Split wallet.cpp: extract key management into wallet_keys.cpp
Separate key management from transaction logic in wallet.cpp (5,059 lines):
- wallet.cpp: 5,059 → 4,143 lines (transaction tracking, coin selection, balances)
- wallet_keys.cpp: 975 lines (key generation, encryption, HD seed, keypool)

Extracted functions include key generation (GenerateNewKey, GenerateNewSaplingZKey),
cryptographic key storage (AddKeyPubKey, AddCryptedKey, AddCryptedSaplingSpendingKey),
wallet encryption (Unlock, ChangeWalletPassphrase, EncryptWallet), HD seed management,
keypool operations, CReserveKey methods, and shielded key visitor operators.
2026-02-27 01:51:24 -06:00
dan_s
a918136a7c 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
2026-02-27 01:51:24 -06:00
dan_s
3d4e25e429 Split hush unity build: move ~14k lines of implementation from headers into hush_impl.cpp and hush_nSPV_impl.cpp
- Add HUSH_PRIVATE_IMPLEMENTATION guard to hush.h separating implementation from declarations
- Create hush_impl.cpp to compile all hush_*.h implementation as a separate translation unit
- Create hush_nSPV_impl.cpp to compile all hush_nSPV_*.h headers separately
- main.cpp now includes declarations only, no longer a unity build for hush code
- Add both new compilation units to Makefile.am
2026-02-26 20:55:12 -06:00