Major fee bump to come to more reasonable values

Starting on the higher side for testnet to see how it goes in
practice. Introduced constants for each smaller unit.
This commit is contained in:
Ignotus Peverell
2017-11-14 20:14:07 -05:00
parent 89217a1fa5
commit 6ac2fe2a8c
4 changed files with 14 additions and 7 deletions
+7 -1
View File
@@ -25,8 +25,14 @@ use std::cmp::max;
use ser;
use core::target::Difficulty;
/// A grin is divisible to 10^9, a nanogrin
/// A grin is divisible to 10^9, following the SI prefixes
pub const GRIN_BASE: u64 = 1_000_000_000;
/// Milligrin, a thousand of a grin
pub const MILLI_GRIN: u64 = GRIN_BASE / 1_000;
/// Microgrin, a thousand of a milligrin
pub const MICRO_GRIN: u64 = MILLI_GRIN / 1_000;
/// Nanogrin, smallest unit, takes a billion to make a grin
pub const NANO_GRIN: u64 = 1;
/// The block subsidy amount
pub const REWARD: u64 = 50 * GRIN_BASE;
+3 -4
View File
@@ -582,10 +582,9 @@ where
return Err(PoolError::OverCapacity);
}
// for a basic transaction (1 input, 2 outputs) -
// (-1 * 1) + (4 * 2) + 1 = 8
// 8 * 10 = 80
//
// for a basic transaction (1 input, 2 outputs) -
// (-1 * 1) + (4 * 2) + 1 = 8
// 8 * 10 = 80
if self.config.accept_fee_base > 0 {
let mut tx_weight = -1 * (tx.inputs.len() as i32) + (4 * tx.outputs.len() as i32) + 1;
if tx_weight < 1 {
+2 -1
View File
@@ -24,6 +24,7 @@ use util::secp::pedersen::Commitment;
pub use graph;
use core::consensus;
use core::core::block;
use core::core::transaction;
use core::core::hash;
@@ -52,7 +53,7 @@ impl Default for PoolConfig {
}
fn default_accept_fee_base() -> u64 {
10
consensus::MILLI_GRIN
}
fn default_max_pool_size() -> usize {
50_000
+2 -1
View File
@@ -32,6 +32,7 @@ use tokio_retry::strategy::FibonacciBackoff;
use api;
use core::consensus;
use core::core::{transaction, Transaction};
use core::ser;
use keychain;
@@ -42,7 +43,7 @@ const DAT_FILE: &'static str = "wallet.dat";
const LOCK_FILE: &'static str = "wallet.lock";
const SEED_FILE: &'static str = "wallet.seed";
const DEFAULT_BASE_FEE: u64 = 10;
const DEFAULT_BASE_FEE: u64 = consensus::MILLI_GRIN;
/// Transaction fee calculation
pub fn tx_fee(input_len: usize, output_len: usize, base_fee: Option<u64>) -> u64 {