It's a limitation of the Bitcoin protocol. The fee is not an explicit
data field. To calculate the fee of a transaction, you need to know the
values of all inputs and outputs. And input values are not explicit
fields either; you need to know their connected outputs and use their value.

In SPV mode, you don't get the connected outputs as they are part of the
ancestor transaction(s) which are not relevant to your wallet.

So in the general case, getFee() will only return non-null for outgoing
transactions, as in this case all ancestors are contained in the wallet.

This limitation has been present in bitcoinj 0.14 and before, so it's
not specific to 0.15. Btw. 0.15 final has been released.


Yes, using 'final' at this point is fine.


On 06/03/2019 08.17, jh...@seekerslab.com wrote:
> Now, i am using bitcoinj 0.15-snapshot.
> 
> And when i add CoinsReceived Listener, Tx is always null. (sometimes
> tx.pending() is null too).
> 
> This is a bug?
> 
> and This is another question.
> 
> public void onCoinsReceived(Wallet wallet, *final **Transaction tx*, Coin 
> prevBalance, Coin newBalance)
> 
> 
> Is it okay to use final keyword?
> 
> 
> -- 
> 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
> <mailto:bitcoinj+unsubscr...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.


-- 
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