Java Code Examples for org.bitcoinj.core.TransactionConfidence#getDepthInBlocks()

The following examples show how to use org.bitcoinj.core.TransactionConfidence#getDepthInBlocks() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WalletService.java    From bisq-core with GNU Affero General Public License v3.0 6 votes vote down vote up
@Nullable
protected TransactionConfidence getMostRecentConfidence(List<TransactionConfidence> transactionConfidenceList) {
    TransactionConfidence transactionConfidence = null;
    for (TransactionConfidence confidence : transactionConfidenceList) {
        if (confidence != null) {
            if (transactionConfidence == null ||
                    confidence.getConfidenceType().equals(TransactionConfidence.ConfidenceType.PENDING) ||
                    (confidence.getConfidenceType().equals(TransactionConfidence.ConfidenceType.BUILDING) &&
                            transactionConfidence.getConfidenceType().equals(
                                    TransactionConfidence.ConfidenceType.BUILDING) &&
                            confidence.getDepthInBlocks() < transactionConfidence.getDepthInBlocks())) {
                transactionConfidence = confidence;
            }
        }
    }
    return transactionConfidence;
}
 
Example 2
Source File: WalletService.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
@Nullable
protected TransactionConfidence getMostRecentConfidence(List<TransactionConfidence> transactionConfidenceList) {
    TransactionConfidence transactionConfidence = null;
    for (TransactionConfidence confidence : transactionConfidenceList) {
        if (confidence != null) {
            if (transactionConfidence == null ||
                    confidence.getConfidenceType().equals(TransactionConfidence.ConfidenceType.PENDING) ||
                    (confidence.getConfidenceType().equals(TransactionConfidence.ConfidenceType.BUILDING) &&
                            transactionConfidence.getConfidenceType().equals(
                                    TransactionConfidence.ConfidenceType.BUILDING) &&
                            confidence.getDepthInBlocks() < transactionConfidence.getDepthInBlocks())) {
                transactionConfidence = confidence;
            }
        }
    }
    return transactionConfidence;
}
 
Example 3
Source File: TxConfidenceListItem.java    From bisq with GNU Affero General Public License v3.0 4 votes vote down vote up
private void updateConfidence(TransactionConfidence confidence, Tooltip tooltip) {
    if (confidence != null) {
        GUIUtil.updateConfidence(confidence, tooltip, txConfidenceIndicator);
        confirmations = confidence.getDepthInBlocks();
    }
}
 
Example 4
Source File: CoreWalletsService.java    From bisq with GNU Affero General Public License v3.0 4 votes vote down vote up
public int getNumConfirmationsForMostRecentTransaction(String addressString) {
    Address address = getAddressEntry(addressString).getAddress();
    TransactionConfidence confidence = btcWalletService.getConfidenceForAddress(address);
    return confidence == null ? 0 : confidence.getDepthInBlocks();
}