Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Itoo on May 12, 2016, 04:06:05 AM



Title: Simple logic to avoid confusing tx fee with transaction amount
Post by: Itoo on May 12, 2016, 04:06:05 AM
I was thinking about the person that accidentally sent about 300 btc as a fee and .001 as the transaction amount, and it occurred to me that some simple logic could be put in place to avoid that. Just add a check to see whether the tx fee is larger than the amount being transferred and if so, either warn the user or reject the transaction or whatever. I don't recall what wallet he was using, but I haven't heard that any wallet has such simple logic yet....



Title: Re: Simple logic to avoid confusing tx fee with transaction amount
Post by: Itoo on May 12, 2016, 04:09:15 AM
And just as I post that I see frejectAbsurdFee in main.cpp. I'll see if my limited skills can determine if that fits the bill


Title: Re: Simple logic to avoid confusing tx fee with transaction amount
Post by: achow101 on May 12, 2016, 04:21:03 AM
Bitcoin core will reject and transaction with an "absurdly high fee". This means that it will not accept it to the mempool and will not relay it. I don't remember what the exact threshold for this is, but I think it is actually fairly low.


Title: Re: Simple logic to avoid confusing tx fee with transaction amount
Post by: goregrind on May 12, 2016, 08:30:55 AM
I was thinking about the person that accidentally sent about 300 btc as a fee and .001 as the transaction amount, and it occurred to me that some simple logic could be put in place to avoid that. Just add a check to see whether the tx fee is larger than the amount being transferred and if so, either warn the user or reject the transaction or whatever. I don't recall what wallet he was using, but I haven't heard that any wallet has such simple logic yet....



The reason this simple logic doesn't work is because there are valid transactions where the amount transferred is less than the tx fee.


Title: Re: Simple logic to avoid confusing tx fee with transaction amount
Post by: shorena on May 12, 2016, 09:51:47 AM
Bitcoin core will reject and transaction with an "absurdly high fee". This means that it will not accept it to the mempool and will not relay it. I don't remember what the exact threshold for this is, but I think it is actually fairly low.

AFAIK its still accepted and relayed, its just refused if you create a TX with a fee over x*min_relay_fee or 0.1 BTC. Not exact numbers just from memory.


Title: Re: Simple logic to avoid confusing tx fee with transaction amount
Post by: fbueller on May 12, 2016, 11:42:35 AM
It's possible the person wasn't using Bitcoin Core at all, and crafted the transaction themselves.

I just find it unlikely someone would spend 9x 30BTC outputs in a raw transaction that was only a test, and ignore the absurdly high fee warning .



Title: Re: Simple logic to avoid confusing tx fee with transaction amount
Post by: Itoo on May 12, 2016, 01:49:15 PM

The reason this simple logic doesn't work is because there are valid transactions where the amount transferred is less than the tx fee.

I mentioned just showing a warning, that allows users to still do what they want....

But why would anyone do this regularly? I can think of some fringe scenarios, but unless you're the miner collecting the fee, you lose money on the deal. So it doesn't make sense for someone to do intentionally under normal circumstances.



Title: Re: Simple logic to avoid confusing tx fee with transaction amount
Post by: Itoo on May 12, 2016, 01:50:55 PM
Bitcoin core will reject and transaction with an "absurdly high fee". This means that it will not accept it to the mempool and will not relay it. I don't remember what the exact threshold for this is, but I think it is actually fairly low.

Aah, I ran into fRejectAbsurdFee while looking into it. I have yet to figure out the criteria for an absurd fee but I'll post it here when/if I do.