diff --git a/grin/src/types.rs b/grin/src/types.rs index a01ca708e..331b89a46 100644 --- a/grin/src/types.rs +++ b/grin/src/types.rs @@ -99,6 +99,8 @@ pub struct ServerConfig { /// Configuration for the mining daemon pub mining_config: Option, + /// Transaction pool configuration + #[serde(default)] pub pool_config: pool::PoolConfig, } diff --git a/pool/src/types.rs b/pool/src/types.rs index 4dcb17f6e..4799b875b 100644 --- a/pool/src/types.rs +++ b/pool/src/types.rs @@ -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