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`.
This commit is contained in:
Sean Gilligan 2023-08-25 15:27:42 -07:00 committed by Andreas Schildbach
parent 19fcdcdd5b
commit 9d78d2bd9e

View file

@ -4497,7 +4497,12 @@ public class Wallet extends BaseTaggableObject
* @return a future for an object that contains transaction confidence information * @return a future for an object that contains transaction confidence information
*/ */
public CompletableFuture<TransactionConfidence> waitForConfirmations(Transaction tx, int requiredConfirmations) { public CompletableFuture<TransactionConfidence> 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());
} }
/** /**