From 9d78d2bd9e52b3776c26032c2a5af52e5e214e3b Mon Sep 17 00:00:00 2001 From: Sean Gilligan Date: Fri, 25 Aug 2023 15:27:42 -0700 Subject: [PATCH] Wallet: add `getConfidence(tx)` method and use it in `waitForConfirmations()` The other `getConfidence()` methods in `Transaction` eventually call the one that takes a `TxConfidenceTable`, so we call that one directly. Also prepares for not using `Transaction` to find the `TransactionConfidence`. --- core/src/main/java/org/bitcoinj/wallet/Wallet.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/bitcoinj/wallet/Wallet.java b/core/src/main/java/org/bitcoinj/wallet/Wallet.java index 077e9d6a4..4136103ba 100644 --- a/core/src/main/java/org/bitcoinj/wallet/Wallet.java +++ b/core/src/main/java/org/bitcoinj/wallet/Wallet.java @@ -4497,7 +4497,12 @@ public class Wallet extends BaseTaggableObject * @return a future for an object that contains transaction confidence information */ public CompletableFuture waitForConfirmations(Transaction tx, int requiredConfirmations) { - return tx.getConfidence().getDepthFuture(requiredConfirmations); + + return getConfidence(tx).getDepthFuture(requiredConfirmations); + } + + private TransactionConfidence getConfidence(Transaction tx) { + return tx.getConfidence(Context.get().getConfidenceTable()); } /**