/** Returns a copy of this object. Event listeners are not duplicated. */ public TransactionConfidence duplicate() { TransactionConfidence c = new TransactionConfidence(hash); c.broadcastBy.addAll(broadcastBy); c.lastBroadcastedAt = lastBroadcastedAt; synchronized (this) { c.confidenceType = confidenceType; c.overridingTransaction = overridingTransaction; c.appearedAtChainHeight = appearedAtChainHeight; } return c; }
/** Returns a copy of this object. Event listeners are not duplicated. */ public TransactionConfidence duplicate() { TransactionConfidence c = new TransactionConfidence(hash); c.broadcastBy.addAll(broadcastBy); c.lastBroadcastedAt = lastBroadcastedAt; synchronized (this) { c.confidenceType = confidenceType; c.overridingTransaction = overridingTransaction; c.appearedAtChainHeight = appearedAtChainHeight; } return c; }
/** Returns a copy of this object. Event listeners are not duplicated. */ public TransactionConfidence duplicate() { TransactionConfidence c = new TransactionConfidence(hash); c.broadcastBy.addAll(broadcastBy); c.lastBroadcastedAt = lastBroadcastedAt; synchronized (this) { c.confidenceType = confidenceType; c.overridingTransaction = overridingTransaction; c.appearedAtChainHeight = appearedAtChainHeight; } return c; }
/** Returns a copy of this object. Event listeners are not duplicated. */ public TransactionConfidence duplicate() { TransactionConfidence c = new TransactionConfidence(hash); c.broadcastBy.addAll(broadcastBy); c.lastBroadcastedAt = lastBroadcastedAt; synchronized (this) { c.confidenceType = confidenceType; c.overridingTransaction = overridingTransaction; c.appearedAtChainHeight = appearedAtChainHeight; } return c; }
/** * Returns the {@link TransactionConfidence} for the given hash if we have downloaded it, or null if that tx hash * is unknown to the system at this time. */ public TransactionConfidence getOrCreate(Sha256Hash hash) { checkNotNull(hash); lock.lock(); try { WeakConfidenceReference reference = table.get(hash); if (reference != null) { TransactionConfidence confidence = reference.get(); if (confidence != null) return confidence; } TransactionConfidence newConfidence = new TransactionConfidence(hash); table.put(hash, new WeakConfidenceReference(newConfidence, referenceQueue)); return newConfidence; } finally { lock.unlock(); } }
/** * Returns the {@link TransactionConfidence} for the given hash if we have downloaded it, or null if that tx hash * is unknown to the system at this time. */ public TransactionConfidence getOrCreate(Sha256Hash hash) { checkNotNull(hash); lock.lock(); try { WeakConfidenceReference reference = table.get(hash); if (reference != null) { TransactionConfidence confidence = reference.get(); if (confidence != null) return confidence; } TransactionConfidence newConfidence = new TransactionConfidence(hash); table.put(hash, new WeakConfidenceReference(newConfidence, referenceQueue)); return newConfidence; } finally { lock.unlock(); } }
/** * Returns the {@link TransactionConfidence} for the given hash if we have downloaded it, or null if that tx hash * is unknown to the system at this time. */ public TransactionConfidence getOrCreate(Sha256Hash hash) { checkNotNull(hash); lock.lock(); try { WeakConfidenceReference reference = table.get(hash); if (reference != null) { TransactionConfidence confidence = reference.get(); if (confidence != null) return confidence; } TransactionConfidence newConfidence = new TransactionConfidence(hash); table.put(hash, new WeakConfidenceReference(newConfidence, referenceQueue)); return newConfidence; } finally { lock.unlock(); } }
/** * Returns the {@link TransactionConfidence} for the given hash if we have downloaded it, or null if that tx hash * is unknown to the system at this time. */ public TransactionConfidence getOrCreate(Sha256Hash hash) { checkNotNull(hash); lock.lock(); try { WeakConfidenceReference reference = table.get(hash); if (reference != null) { TransactionConfidence confidence = reference.get(); if (confidence != null) return confidence; } TransactionConfidence newConfidence = new TransactionConfidence(hash); table.put(hash, new WeakConfidenceReference(newConfidence, referenceQueue)); return newConfidence; } finally { lock.unlock(); } }