[bisq-network/bisq] Speed up deposit and transactions view loads (#5120)

chimp1984 notifications at github.com
Sat Jan 30 18:00:24 CET 2021


@chimp1984 commented on this pull request.



> @@ -408,18 +430,15 @@ public TransactionConfidence getConfidenceForTxId(String txId) {
         return null;
     }
 
-    protected TransactionConfidence getTransactionConfidence(Transaction tx, Address address) {
-        List<TransactionConfidence> transactionConfidenceList = getOutputsWithConnectedOutputs(tx)
-                .stream()
-                .filter(WalletService::isOutputScriptConvertibleToAddress)
-                .filter(output -> address != null && address.equals(getAddressFromOutput(output)))
-                .map(o -> tx.getConfidence())
-                .collect(Collectors.toList());
-        return getMostRecentConfidence(transactionConfidenceList);
+    private TransactionConfidence getTransactionConfidence(Transaction tx, Address address) {
+        boolean matchesAddress = getOutputsWithConnectedOutputs(tx).stream()
+                .anyMatch(output -> address != null && address.equals(getAddressFromOutput(output)));
+
+        return matchesAddress ? getMostRecentConfidence(List.of(tx.getConfidence())) : null;

Oh, yes looks like that `.map(o -> tx.getConfidence())` was a bug. I think intention was to find all txs where the address was used for receiving or sending BTC. And take the most recent confidence. Unforunately the design flaw to use addresses so dominantely causes many issues in many area. Maybe we can slowely try to convert the domain model to use txos as the core entity and if the UI needs to show addresses we grab the collection of txos related to that address.



-- 
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/5120#discussion_r567276219
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210130/80cbdc6f/attachment.htm>


More information about the bisq-github mailing list