dimxy / komodo

Komodo
https://komodoplatform.com/
Other
7 stars 4 forks source link

Add tx to mempool error -25 missing inputs or -26 inputs already spent while batch loading #41

Closed dimxy closed 4 years ago

dimxy commented 4 years ago

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

dimxy commented 4 years ago

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)