<p><b>@julianknutsen</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/bisq-network/bisq/pull/3773#discussion_r356365851">core/src/main/java/bisq/core/dao/node/parser/BlockParser.java</a>:</p>
<pre style='color:#555'>>  
         rawBlock.getRawTxs().forEach(rawTx ->
                 txParser.findTx(rawTx,
                         genesisTxId,
                         genesisBlockHeight,
                         genesisTotalSupply)
-                        .ifPresent(txList::add));
+                        .ifPresent(daoStateService::onNewTxForLastBlock));
</pre>
<p>Ok, I read the comment above this <code>forEach</code> and followed the <code>TxInputParser</code> code. There is definitely a non-encapsulated relationship between the DaoStateService and Block.</p>
<p>In order to not make it worse, I might suggest leaving this as <code>block.getTxns().add(txn)</code> and having the <code>onParseBlockComplete()</code> update the cache, instead.</p>
<p>This fits more of the existing model where the <code>BlockParser</code> creates the object and the <code>DaoStateService</code> takes that object and uses it. It seems natural that the <code>DaoStateService::onParseBlockComplete</code> could be used to update cached data that it needs for its public API.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/3773?email_source=notifications&email_token=AJFFTNQ67MXCPS5QW2KSGBTQYA7YLA5CNFSM4JZCA3Q2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCOXUJHQ#discussion_r356365851">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNUID2E4WUV2IM754QLQYA7YLANCNFSM4JZCA3QQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNVPTK4AC4S5BIFCNCLQYA7YLA5CNFSM4JZCA3Q2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCOXUJHQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/3773?email_source=notifications\u0026email_token=AJFFTNQ67MXCPS5QW2KSGBTQYA7YLA5CNFSM4JZCA3Q2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCOXUJHQ#discussion_r356365851",
"url": "https://github.com/bisq-network/bisq/pull/3773?email_source=notifications\u0026email_token=AJFFTNQ67MXCPS5QW2KSGBTQYA7YLA5CNFSM4JZCA3Q2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCOXUJHQ#discussion_r356365851",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>