Bitcoin Forum

Bitcoin => BitcoinJ => Topic started by: spazzdla on September 01, 2017, 03:59:06 PM



Title: Android Bitcoin wallet and changing the fee.
Post by: spazzdla on September 01, 2017, 03:59:06 PM
"bitcoinj 0.14.5"   Version wallet 5.31

anyone know how to set a custom fee? 


Title: Re: Android Bitcoin wallet and changing the fee.
Post by: Forsyth Jones on March 25, 2018, 11:58:20 PM
"bitcoinj 0.14.5"   Version wallet 5.31

anyone know how to set a custom fee? 
  I'd like to know too..


Title: Re: Android Bitcoin wallet and changing the fee.
Post by: HCP on April 06, 2018, 05:07:28 AM
From the docs it seems you need to use the "SendRequest" object...
Using fees
Transactions can have fees attached to them when they are completed by the wallet. To control this, the SendRequest object has several fields that can be used. The simplest is SendRequest.fee which is an absolute override. If set, that is the fee that will be attached. A more useful field is SendRequest.feePerKb which allows you to scale the final fee with the size of the completed transaction. When block space is limited, miners decide ranking by fee-per-1000-bytes so typically you do want to pay more for larger transactions, otherwise you may fall below miners fee thresholds.

also here: https://bitcoinj.github.io/getting-started-java#customizing-the-sending-process-and-setting-fees

However, the javadoc for 0.14.5 seems to indicate that only feePerKb exists: https://bitcoinj.github.io/javadoc/0.14.5/