Merge pull request #3014

deeffaeb blockchain: remove minor floating point usage (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2018-01-25 16:38:32 -08:00
commit 9872620781
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD

View file

@ -2933,7 +2933,7 @@ bool Blockchain::check_fee(size_t blob_size, uint64_t fee) const
needed_fee += (blob_size % 1024) ? 1 : 0;
needed_fee *= fee_per_kb;
if (fee < needed_fee * 0.98) // keep a little buffer on acceptance
if (fee < needed_fee - needed_fee / 50) // keep a little 2% buffer on acceptance - no integer overflow
{
MERROR_VER("transaction fee is not enough: " << print_money(fee) << ", minimum fee: " << print_money(needed_fee));
return false;