core: dynamic fee algorithm from ArticMine

The fee will vary based on the base reward and the current
block size limit:

fee = (R/R0) * (M0/M) * F0

R: base reward
R0: reference base reward (10 monero)
M: block size limit
M0: minimum block size limit (60000)
F0: 0.002 monero

Starts applying at v4
This commit is contained in:
moneromooo-monero
2016-10-27 23:43:44 +01:00
parent 83b0511731
commit 82dbba10d4
6 changed files with 206 additions and 5 deletions
+1 -5
View File
@@ -133,12 +133,8 @@ namespace cryptonote
fee = tx.rct_signatures.txnFee;
}
uint64_t needed_fee = blob_size / 1024;
needed_fee += (blob_size % 1024) ? 1 : 0;
needed_fee *= FEE_PER_KB;
if (!kept_by_block && fee < needed_fee)
if (!kept_by_block && !m_blockchain.check_fee(blob_size, fee))
{
LOG_PRINT_L1("transaction fee is not enough: " << print_money(fee) << ", minimum fee: " << print_money(needed_fee));
tvc.m_verifivation_failed = true;
tvc.m_fee_too_low = true;
return false;