Hello. I'm using bitcoinj 0.14.7. I have a little problem. I cannot get 
transaction fee value. It's always null. Here is your code: 


public Coin getFee() {
    Coin fee = Coin.ZERO;
    if (inputs.isEmpty() || outputs.isEmpty()) // Incomplete transaction
        return null;
    for (TransactionInput input : inputs) {
        if (input.getValue() == null)
            return null;
        fee = fee.add(input.getValue());
    }
    for (TransactionOutput output : outputs) {
        fee = fee.subtract(output.getValue());
    }
    return fee;
}


According to my debugging, it happens because input.getValue() returns null. I 
tried to get input value using input.getConnectedOutput().getValue(), but 
result is the same. I think that it's also important to mention, that I took 
all these transactions using BlocksDownloadedEventListener. 

Can somebody please help me?

-- 
You received this message because you are subscribed to the Google Groups 
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bitcoinj+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to