Scenario: you switch from full node to spv node or replace your blockchain db or something that causes the chain to restart at some low height (like 0) but you keep your walletDB. What happens is, the wdb internally unconfirms ALL txs, then when it gets reopened (maybe after a restart) it tries to resend your entire TX history, thinking everything is just pending:
Scenario: you switch from full node to spv node or replace your blockchain db or something that causes the chain to restart at some low height (like 0) but you keep your walletDB. What happens is, the wdb internally unconfirms ALL txs, then when it gets reopened (maybe after a restart) it tries to resend your entire TX history, thinking everything is just pending:
https://github.com/handshake-org/hsd/blob/f28fb9edcf34e78433e4da316d42e82d0d42ee46/lib/wallet/walletdb.js#L1661-L1677
We could probably be smarter about this, and hold off on the
resend()
if we can determine that the chain's height is way behind the walletdb height