What's Changed
Ships the recovery path for testnet / teratestnet nodes wedged by the pre-v0.15.7 OP_RETURN spend bug. Adds a teranode-cli rewindblockchain subcommand that rewinds the local blockchain past the bad block so the node can re-sync from there with v0.15.7's store-time fix in effect.
Identical to v0.15.8-beta-2.
teranode-cli rewindblockchain subcommand (backport #1345 / #1341)
Registers the destructive-rewind tool as a teranode-cli subcommand:
--target-height <h>— target height (default: readstate["BlockAssembler"])--dry-run— log actions, modify nothing--assume-yes— skip the interactive confirmation prompt--force-not-idle— proceed even if FSM is notIDLE(DANGEROUS)--force-deep— allow rewind deeper than 100 blocks (coinbase-maturity risk)--verify— run post-rewind consistency checks--concurrency <n>— subtree-load concurrency
Interactive confirmation tolerates piped input (printf y | teranode-cli ...) and reports a clearer error under non-interactive contexts. Positional-argument guard rejects the swallowed-flag invocation before any store is opened.
rewindblockchain never advances BlockPersisterHeight (backport #1342 / #1340)
The rewind tool now clamps state["BlockPersisterHeight"] against the blocks-table ground truth (lowest block with persisted_at IS NULL, minus one) and refuses to write a value that would move the persister forward.
rewindblockchain opens the subtree store with the node's hashPrefix (backport #1352 / #1351)
Reads ?hashPrefix= from the subtree store URL (default 2, matching daemon.GetSubtreeStore) and passes it into NewStore, so the rewind tool shares the node's exact blob path layout and its Del calls actually match what the node wrote.
- feat(teranode-cli): register rewindblockchain subcommand by @oskarszoon (backport of #1345 / #1341)
- fix(rewindblockchain): never move BlockPersisterHeight forward on rewind by @oskarszoon (backport of #1342 / #1340)
- fix(rewindblockchain): open the subtree store with the node's hashPrefix by @oskarszoon (backport of #1352 / #1351)
Full Changelog: v0.15.7...v0.15.8