[bisq-network/bisq] Add transient tx map to DaoState to speed up getTx queries (#3773)

Julian Knutsen notifications at github.com
Wed Dec 11 01:36:05 UTC 2019


julianknutsen commented on this pull request.



>  
         rawBlock.getRawTxs().forEach(rawTx ->
                 txParser.findTx(rawTx,
                         genesisTxId,
                         genesisBlockHeight,
                         genesisTotalSupply)
-                        .ifPresent(txList::add));
+                        .ifPresent(daoStateService::onNewTxForLastBlock));

Ok, I read the comment above this `forEach` and followed the `TxInputParser` code. There is definitely a non-encapsulated relationship between the DaoStateService and Block.

In order to not make it worse, I might suggest leaving this as `block.getTxns().add(txn)` and having the `onParseBlockComplete()` update the cache, instead.

This fits more of the existing model where the `BlockParser` creates the object and the `DaoStateService` takes that object and uses it. It seems natural that the `DaoStateService::onParseBlockComplete` could be used to update cached data that it needs for its public API.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/3773#discussion_r356365851
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191210/0afe8fa9/attachment.html>


More information about the bisq-github mailing list