Skip to content

Commit

Permalink
simplified getTRansactionConfidence
Browse files Browse the repository at this point in the history
  • Loading branch information
jim618 committed Feb 27, 2016
1 parent 222f33b commit 4bbe110
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions core/src/main/java/org/bitcoinj/core/Transaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -1162,14 +1162,13 @@ public TransactionConfidence getConfidence(TxConfidenceTable table) {
// Use the confidence from the table as that is all we have
confidence = confidenceInTable;
} else {
// Check the confidence in the Context confidence table is the same object
if (System.identityHashCode(confidence) != System.identityHashCode(confidenceInTable)) {
log.debug("Confidence in tx has identity {} but the one in the confidence table is {}", System.identityHashCode(confidence), System.identityHashCode(confidenceInTable));

if (ConfidenceType.UNKNOWN.equals(confidenceInTable.getConfidenceType())) {
// Do not override an extant confidence if the confidenceType is Unknown
log.debug("Not overriding confidence as confidenceType is Unknown");
} else {
// Do not override local copy with a null Confidence in the TxConfidenceTable
if (confidenceInTable != null) {
// Check the confidence in the Context confidence table is the same object
// If Confidence objects are the same then do nothing
if (System.identityHashCode(confidence) != System.identityHashCode(confidenceInTable)) {
log.debug("Confidence in tx has identity {} but the one in the confidence table is {}", System.identityHashCode(confidence), System.identityHashCode(confidenceInTable));

log.debug("Using the one in the confidence table");
confidence = confidenceInTable;
}
Expand Down

0 comments on commit 4bbe110

Please sign in to comment.