Re: Wallet fee calculation - special case for outputs < 0.01 BTC

2017-03-17 Thread Andreas Schildbach
Great, that's good news! I think we can just copy Core's behaviour here.
The 0.01 BTC thing is probably some remains from the "free transaction"
rule. You basically didn't have to pay a fee if none of your outputs was
too dusty. The rule doesn't exist any more in Core.



On 03/17/2017 10:39 PM, Oscar Guindzberg wrote:
> I mean Transaction.REFERENCE_DEFAULT_MIN_TX_FEE (currently set to 5000
> satoshis/kb)
> 
> On Fri, Mar 17, 2017 at 6:38 PM, Oscar Guindzberg
>  wrote:
>> I am rewriting Wallet.calculateFee().
>>
>> I am copying bitcoin-core implementation so we can have "recipient pay
>> fees" feature and other fixes.
>>
>> This is the code I am copying from
>> https://github.com/bitcoin/bitcoin/blob/9c7b7cf0bb579714b35f7c88db20a407dfc716bd/src/wallet/wallet.cpp#L2302-L2629
>>
>>
>> One thing I don't understand in our current code is why we do
>> something "special" when there is an output whose value is less than
>> 0.01 BTC.
>> In that case we make sure the tx fee is at least
>> Transaction.REFERENCE_DEFAULT_MIN_TX_FEE (currently set to 500
>> satoshis/kb)
>> See 
>> https://github.com/bitcoinj/bitcoinj/blob/v0.14.4/core/src/main/java/org/bitcoinj/wallet/Wallet.java#L4873-L4874
>>
>> I could not find anything in bitcoin-core code that does anything
>> special when a tx output value is less than 0.01 BTC
>>
>> I found release notes for version 0.3.21
>> https://github.com/bitcoin/bitcoin/blob/9c7b7cf0bb579714b35f7c88db20a407dfc716bd/doc/release-notes/release-notes-0.3.21.md
>> which shows at that time they were doing something special.
>> But release notes for version 0.9
>> https://github.com/bitcoin/bitcoin/blob/9c7b7cf0bb579714b35f7c88db20a407dfc716bd/doc/release-notes/release-notes-0.9.0.md
>> shows the feature was disabled.
>>
>> So... I will assume nothing special should be done for outputs < 0.01
>> BTC in my new Wallet.calculateFee() implementation.
>>
>> Please, correct me if I am wrong.
>>
>> Regards, Oscar
> 
> 
> 


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


Re: Wallet fee calculation - special case for outputs < 0.01 BTC

2017-03-17 Thread Oscar Guindzberg
I mean Transaction.REFERENCE_DEFAULT_MIN_TX_FEE (currently set to 5000
satoshis/kb)

On Fri, Mar 17, 2017 at 6:38 PM, Oscar Guindzberg
 wrote:
> I am rewriting Wallet.calculateFee().
>
> I am copying bitcoin-core implementation so we can have "recipient pay
> fees" feature and other fixes.
>
> This is the code I am copying from
> https://github.com/bitcoin/bitcoin/blob/9c7b7cf0bb579714b35f7c88db20a407dfc716bd/src/wallet/wallet.cpp#L2302-L2629
>
>
> One thing I don't understand in our current code is why we do
> something "special" when there is an output whose value is less than
> 0.01 BTC.
> In that case we make sure the tx fee is at least
> Transaction.REFERENCE_DEFAULT_MIN_TX_FEE (currently set to 500
> satoshis/kb)
> See 
> https://github.com/bitcoinj/bitcoinj/blob/v0.14.4/core/src/main/java/org/bitcoinj/wallet/Wallet.java#L4873-L4874
>
> I could not find anything in bitcoin-core code that does anything
> special when a tx output value is less than 0.01 BTC
>
> I found release notes for version 0.3.21
> https://github.com/bitcoin/bitcoin/blob/9c7b7cf0bb579714b35f7c88db20a407dfc716bd/doc/release-notes/release-notes-0.3.21.md
> which shows at that time they were doing something special.
> But release notes for version 0.9
> https://github.com/bitcoin/bitcoin/blob/9c7b7cf0bb579714b35f7c88db20a407dfc716bd/doc/release-notes/release-notes-0.9.0.md
> shows the feature was disabled.
>
> So... I will assume nothing special should be done for outputs < 0.01
> BTC in my new Wallet.calculateFee() implementation.
>
> Please, correct me if I am wrong.
>
> Regards, Oscar



-- 
Oscar Guindzberg

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


Wallet fee calculation - special case for outputs < 0.01 BTC

2017-03-17 Thread Oscar Guindzberg
I am rewriting Wallet.calculateFee().

I am copying bitcoin-core implementation so we can have "recipient pay
fees" feature and other fixes.

This is the code I am copying from
https://github.com/bitcoin/bitcoin/blob/9c7b7cf0bb579714b35f7c88db20a407dfc716bd/src/wallet/wallet.cpp#L2302-L2629


One thing I don't understand in our current code is why we do
something "special" when there is an output whose value is less than
0.01 BTC.
In that case we make sure the tx fee is at least
Transaction.REFERENCE_DEFAULT_MIN_TX_FEE (currently set to 500
satoshis/kb)
See 
https://github.com/bitcoinj/bitcoinj/blob/v0.14.4/core/src/main/java/org/bitcoinj/wallet/Wallet.java#L4873-L4874

I could not find anything in bitcoin-core code that does anything
special when a tx output value is less than 0.01 BTC

I found release notes for version 0.3.21
https://github.com/bitcoin/bitcoin/blob/9c7b7cf0bb579714b35f7c88db20a407dfc716bd/doc/release-notes/release-notes-0.3.21.md
which shows at that time they were doing something special.
But release notes for version 0.9
https://github.com/bitcoin/bitcoin/blob/9c7b7cf0bb579714b35f7c88db20a407dfc716bd/doc/release-notes/release-notes-0.9.0.md
shows the feature was disabled.

So... I will assume nothing special should be done for outputs < 0.01
BTC in my new Wallet.calculateFee() implementation.

Please, correct me if I am wrong.

Regards, Oscar

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