Search in sources :

Example 1 with Transaction

use of com.neemre.btcdcli4j.core.domain.Transaction in project bisq-core by bisq-network.

the class RpcService method requestFees.

public void requestFees(String txId, int blockHeight, Map<Integer, Long> feesByBlock) throws BsqBlockchainException {
    try {
        Transaction transaction = requestTx(txId);
        final BigDecimal fee = transaction.getFee();
        if (fee != null)
            feesByBlock.put(blockHeight, Math.abs(fee.multiply(BigDecimal.valueOf(Coin.COIN.value)).longValue()));
    } catch (BitcoindException | CommunicationException e) {
        log.error("error at requestFees with txId={}, blockHeight={}", txId, blockHeight);
        throw new BsqBlockchainException(e.getMessage(), e);
    }
}
Also used : BsqBlockchainException(bisq.core.dao.blockchain.exceptions.BsqBlockchainException) RawTransaction(com.neemre.btcdcli4j.core.domain.RawTransaction) Transaction(com.neemre.btcdcli4j.core.domain.Transaction) CommunicationException(com.neemre.btcdcli4j.core.CommunicationException) BitcoindException(com.neemre.btcdcli4j.core.BitcoindException) BigDecimal(java.math.BigDecimal)

Aggregations

BsqBlockchainException (bisq.core.dao.blockchain.exceptions.BsqBlockchainException)1 BitcoindException (com.neemre.btcdcli4j.core.BitcoindException)1 CommunicationException (com.neemre.btcdcli4j.core.CommunicationException)1 RawTransaction (com.neemre.btcdcli4j.core.domain.RawTransaction)1 Transaction (com.neemre.btcdcli4j.core.domain.Transaction)1 BigDecimal (java.math.BigDecimal)1