nopara73 / HBitcoin

Privacy focused Bitcoin library on top of NBitcoin for .NET Core.
MIT License
25 stars 11 forks source link

Optimize WalletJob's StallMempool #11

Closed nopara73 closed 7 years ago

nopara73 commented 7 years ago

After: https://github.com/nopara73/HBitcoin/issues/6 Related: https://github.com/nopara73/HBitcoin/issues/10

It's not done in the best possible way, we could gain a second or two refactoring it.

dangershony commented 7 years ago

What's the purpose of mempool? Just storing unconfirmed trx associated to any tracked addresses right?

nopara73 commented 7 years ago

Answered here: https://github.com/nopara73/HBitcoin/issues/10#issuecomment-290838162

The short answer is no: the MemPoolJob keeps all tx hashes up to date and raises an event when a new transaction arrives (not only tx hash, but full transaction). Also it does not track the transactions, the WalletJob subscribes to the MemPoolJob's transactions and it calls the tracker to process that transaction, if it needs to be tracked or not. Then the tracker starts tracking it or not.

nopara73 commented 7 years ago

https://github.com/nopara73/HBitcoin/commit/987dfc6dc753708ee8e249bb4d44f039713d7fa6