Search in sources :

Example 1 with TxConfidenceListener

use of io.bitsquare.btc.listeners.TxConfidenceListener in project bitsquare by bitsquare.

the class TxIdTextField method setup.

public void setup(String txID) {
    if (txConfidenceListener != null)
        walletService.removeTxConfidenceListener(txConfidenceListener);
    txConfidenceListener = new TxConfidenceListener(txID) {

        @Override
        public void onTransactionConfidenceChanged(TransactionConfidence confidence) {
            updateConfidence(confidence);
        }
    };
    walletService.addTxConfidenceListener(txConfidenceListener);
    updateConfidence(walletService.getConfidenceForTxId(txID));
    textField.setText(txID);
    textField.setOnMouseClicked(mouseEvent -> openBlockExplorer(txID));
    blockExplorerIcon.setOnMouseClicked(mouseEvent -> openBlockExplorer(txID));
    copyIcon.setOnMouseClicked(e -> Utilities.copyToClipboard(txID));
}
Also used : TxConfidenceListener(io.bitsquare.btc.listeners.TxConfidenceListener) TransactionConfidence(org.bitcoinj.core.TransactionConfidence)

Aggregations

TxConfidenceListener (io.bitsquare.btc.listeners.TxConfidenceListener)1 TransactionConfidence (org.bitcoinj.core.TransactionConfidence)1