reorg cache fix (#3495)

* reorg cache period configurable

* fix comment

* u32 type

Co-authored-by: deevope <you@example.com>
This commit is contained in:
deevope
2020-11-25 17:59:37 +00:00
committed by GitHub
parent 3efe382e9c
commit fd5dfaaec4
4 changed files with 20 additions and 1 deletions
+9
View File
@@ -107,6 +107,11 @@ pub struct PoolConfig {
#[serde(default = "default_accept_fee_base")]
pub accept_fee_base: u64,
// Reorg cache retention period in minute.
// The reorg cache repopulates local mempool in a reorg scenario.
#[serde(default = "default_reorg_cache_period")]
pub reorg_cache_period: u32,
/// Maximum capacity of the pool in number of transactions
#[serde(default = "default_max_pool_size")]
pub max_pool_size: usize,
@@ -126,6 +131,7 @@ impl Default for PoolConfig {
fn default() -> PoolConfig {
PoolConfig {
accept_fee_base: default_accept_fee_base(),
reorg_cache_period: default_reorg_cache_period(),
max_pool_size: default_max_pool_size(),
max_stempool_size: default_max_stempool_size(),
mineable_max_weight: default_mineable_max_weight(),
@@ -136,6 +142,9 @@ impl Default for PoolConfig {
fn default_accept_fee_base() -> u64 {
consensus::MILLI_GRIN
}
fn default_reorg_cache_period() -> u32 {
30
}
fn default_max_pool_size() -> usize {
50_000
}