This issue appeared in token-fix-v2 branch.
When loading 100K cc txns (with PoW mining turned on on the node) at the moment of block creation a -25 error occurred in the sendrawtransaction call.
Surrounded TestBlockValidity with cs_main and the error cleared.
Then optimised myIsutxo_spentinmempool with the use of mempool spent index - the err reappeared.
Added CMempoolStateSaver - the err continued
Used myAddToMempool with mempool indexes fixes (instead of simply mempool.addunchecked ) in CheckBlock() - the err cleared
fixed with addition CMempoolStateSaver which clears mempool from cc txns forced to mempool from the connected block plus the fixed mempool indexes (see also #40 and #38)
This issue appeared in token-fix-v2 branch. When loading 100K cc txns (with PoW mining turned on on the node) at the moment of block creation a -25 error occurred in the sendrawtransaction call. Surrounded TestBlockValidity with cs_main and the error cleared. Then optimised myIsutxo_spentinmempool with the use of mempool spent index - the err reappeared. Added CMempoolStateSaver - the err continued Used myAddToMempool with mempool indexes fixes (instead of simply mempool.addunchecked ) in CheckBlock() - the err cleared