mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-20 19:11:08 +03:00
Default values for pool config
Allows for deserializing config file without having to specify all properties in it.
This commit is contained in:
parent
1e73e3aefc
commit
0d26daadc5
2 changed files with 9 additions and 2 deletions
|
@ -99,6 +99,8 @@ pub struct ServerConfig {
|
|||
/// Configuration for the mining daemon
|
||||
pub mining_config: Option<pow::types::MinerConfig>,
|
||||
|
||||
/// Transaction pool configuration
|
||||
#[serde(default)]
|
||||
pub pool_config: pool::PoolConfig,
|
||||
}
|
||||
|
||||
|
|
|
@ -34,21 +34,26 @@ pub struct PoolConfig {
|
|||
/// Base fee for a transaction to be accepted by the pool. The transaction
|
||||
/// weight is computed from its number of inputs, outputs and kernels and
|
||||
/// multipled by the base fee to compare to the actual transaction fee.
|
||||
#[serde="default_accept_fee_base"]
|
||||
pub accept_fee_base: u64,
|
||||
|
||||
/// Maximum capacity of the pool in number of transactions
|
||||
#[serde="default_max_pool_size"]
|
||||
pub max_pool_size: usize,
|
||||
}
|
||||
|
||||
impl Default for PoolConfig {
|
||||
fn default() -> PoolConfig {
|
||||
PoolConfig {
|
||||
accept_fee_base: 10,
|
||||
max_pool_size: 50_000,
|
||||
accept_fee_base: default_accept_fee_base(),
|
||||
max_pool_size: default_max_pool_size(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn default_accept_fee_base() -> u64 { 10 }
|
||||
fn default_max_pool_size() -> usize { 50_000 }
|
||||
|
||||
/// Placeholder: the data representing where we heard about a tx from.
|
||||
///
|
||||
/// Used to make decisions based on transaction acceptance priority from
|
||||
|
|
Loading…
Reference in a new issue