From c5b3b68ace990ee876587a3e2c2794796ef3ace2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 9 Jan 2019 02:18:19 -1100 Subject: [PATCH 1/2] Increase witness cache size for maxreorg --- src/komodo_utils.h | 3 +++ src/wallet/wallet.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 6010cf4c4..2252cce38 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1650,6 +1650,7 @@ uint64_t komodo_ac_block_subsidy(int nHeight) } extern int64_t MAX_MONEY; +extern unsigned int WITNESS_CACHE_SIZE; void komodo_args(char *argv0) { @@ -1702,6 +1703,8 @@ void komodo_args(char *argv0) } KOMODO_STOPAT = GetArg("-stopat",0); MAX_REORG_LENGTH = GetArg("-maxreorg",MAX_REORG_LENGTH); + WITNESS_CACHE_SIZE = MAX_REORG_LENGTH+10; + ASSETCHAINS_CC = GetArg("-ac_cc",0); KOMODO_CCACTIVATE = GetArg("-ac_ccactivate",0); ASSETCHAINS_PUBLIC = GetArg("-ac_public",0); diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 29f1737eb..653603ff7 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -76,7 +76,7 @@ static const unsigned int MAX_FREE_TRANSACTION_CREATE_SIZE = 1000; // Should be large enough that we can expect not to reorg beyond our cache // unless there is some exceptional network disruption. #define _COINBASE_MATURITY 100 -static const unsigned int WITNESS_CACHE_SIZE = _COINBASE_MATURITY+10; +unsigned int WITNESS_CACHE_SIZE = _COINBASE_MATURITY+10; //! Size of HD seed in bytes static const size_t HD_WALLET_SEED_LENGTH = 32; From 02d75902ad4a84c2e5042dd29fab9f228d640f28 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 9 Jan 2019 02:30:47 -1100 Subject: [PATCH 2/2] Move declaration WITNESS_CACHE --- src/komodo_globals.h | 1 + src/komodo_utils.h | 1 - src/wallet/wallet.h | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/komodo_globals.h b/src/komodo_globals.h index a14cea753..8a72b5ad7 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -44,6 +44,7 @@ struct komodo_state KOMODO_STATES[34]; #define _COINBASE_MATURITY 100 int COINBASE_MATURITY = _COINBASE_MATURITY;//100; +unsigned int WITNESS_CACHE_SIZE = _COINBASE_MATURITY+10; int32_t KOMODO_MININGTHREADS = -1,IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,ASSETCHAINS_SEED,KOMODO_ON_DEMAND,KOMODO_EXTERNAL_NOTARIES,KOMODO_PASSPORT_INITDONE,KOMODO_PAX,KOMODO_EXCHANGEWALLET,KOMODO_REWIND,KOMODO_CONNECTING = -1,KOMODO_DEALERNODE,KOMODO_EXTRASATOSHI,ASSETCHAINS_FOUNDERS; int32_t KOMODO_INSYNC,KOMODO_LASTMINED,prevKOMODO_LASTMINED,KOMODO_CCACTIVATE,JUMBLR_PAUSE = 1; diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 2252cce38..a5b22e592 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1650,7 +1650,6 @@ uint64_t komodo_ac_block_subsidy(int nHeight) } extern int64_t MAX_MONEY; -extern unsigned int WITNESS_CACHE_SIZE; void komodo_args(char *argv0) { diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 653603ff7..c8f9bcbb6 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -75,8 +75,8 @@ static const unsigned int MAX_FREE_TRANSACTION_CREATE_SIZE = 1000; //! Size of witness cache // Should be large enough that we can expect not to reorg beyond our cache // unless there is some exceptional network disruption. -#define _COINBASE_MATURITY 100 -unsigned int WITNESS_CACHE_SIZE = _COINBASE_MATURITY+10; +extern unsigned int WITNESS_CACHE_SIZE; + //! Size of HD seed in bytes static const size_t HD_WALLET_SEED_LENGTH = 32;