resetSpentToAvailable
Reset ALL SPENT UTXOs to AVAILABLE for healing during full resync.
Purpose: Self-healing corrupted UTXO state.
Why reset ALL (including spentByLocalTx=true)? During a FULL resync, we replay ALL transactions from the beginning. The sync will correctly re-mark spent UTXOs as SPENT based on actual blockchain history. So it's safe to reset everything.
This fixes issues where UTXOs were incorrectly marked with spentByLocalTx=true (e.g., old error 115 handling bug).
Flow:
Reset ALL SPENT → AVAILABLE
Full sync replays all transactions
Spending transactions re-mark UTXOs as SPENT (correct)
Unspent UTXOs stay AVAILABLE (healed!)
Return
Number of UTXOs reset
Parameters
address
Owner address