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

<hr>

<p>In <a href="https://github.com/bisq-network/bisq/pull/5120#discussion_r567016742">core/src/main/java/bisq/core/btc/wallet/WalletService.java</a>:</p>
<pre style='color:#555'>> @@ -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;
</pre>
<p>Yes, I wasn't completely sure of the intent of the original version and tried to preserve its behaviour, but it looks like it may have been broken. The original stream pipeline had the line:</p>
<blockquote>
<p>.map(o -> tx.getConfidence())</p>
</blockquote>
<p>But <code>tx</code> is the underlying method parameter and so this just fed a repeating list of the same <code>TransactionConfidence</code> object into <code>getMostRecentConfidence</code>.</p>
<p>I think it may be fixed by restoring the original pipeline, but using the lines:</p>
<blockquote>
<p>.flatMap(o -> Stream.ofNullable(o.getParentTransaction()))<br>
.map(Transaction::getConfidence)</p>
</blockquote>
<p>in place of the <code>o -> tx.getConfidence</code> mapping.</p>
<p>This would make the method return null if (there was no matching output and) none of the tx inputs with the given address has a connecting parent tx (though I'm not sure if the latter ever happens). I guess that would be the right behaviour.</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/5120#discussion_r567016742">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNWIOWK2YU44HDNE4GLS4L52JANCNFSM4WUQ5CFA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNWHHOYT47VXPU7CGDTS4L52JA5CNFSM4WUQ5CFKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOEKFL3DI.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/5120#discussion_r567016742",
"url": "https://github.com/bisq-network/bisq/pull/5120#discussion_r567016742",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>