Reset InMempool txs to Inactive before connecting to the node#2051
Conversation
ImplOfAnImpl
left a comment
There was a problem hiding this comment.
As I mentioned earlier, mempool can evict transactions - there is a size limit for the entire mempool and an expiration time for each tx. Though at this memoment it's unlikely to happen (the size limit is 300Mb and expiration time 2 weeks), it's better to fix the problem fully from the beginning. At this moment eviction only happens after a new tx has been added to the mempool. So the fix could be that whenever the wallet receives a NewTransaction event, it would obtain all InMempool tx ids from the output cache, check which of them are no longer in mempool and reset their status. (though it's better not to use MempoolRpc::contains_tx for checking and instead introduce an additional method that would operate on a set of ids, to avoid the rpc calls overhead).
1dafd7c to
f06734b
Compare
I added a TODO for this |
…nsumed` collection. Add a note and a todo, update changelog
…et db and optionally emit a wallet event
03bb838 to
ed575b8
Compare
We reset all InMempool transactions back to Inactive on
so that we can rescan them from the node when we connect back.