diff --git a/src/chainparams.h b/src/chainparams.h index c60baf6e3..853a43e22 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -92,23 +92,23 @@ protected: CMessageHeader::MessageStartChars pchMessageStart; //! Raw pub key bytes for the broadcast alert signing key. std::vector vAlertPubKey; - int nDefaultPort; - int nMinerThreads; - long nMaxTipAge; - uint64_t nPruneAfterHeight; - unsigned int nEquihashN; - unsigned int nEquihashK; + int nDefaultPort = 0; + int nMinerThreads = 0; + long nMaxTipAge = 0; + uint64_t nPruneAfterHeight = 0; + unsigned int nEquihashN = 0; + unsigned int nEquihashK = 0; std::vector vSeeds; std::vector base58Prefixes[MAX_BASE58_TYPES]; std::string strNetworkID; CBlock genesis; std::vector vFixedSeeds; - bool fRequireRPCPassword; - bool fMiningRequiresPeers; - bool fDefaultConsistencyChecks; - bool fRequireStandard; - bool fMineBlocksOnDemand; - bool fTestnetToBeDeprecatedFieldRPC; + bool fRequireRPCPassword = false; + bool fMiningRequiresPeers = false; + bool fDefaultConsistencyChecks = false; + bool fRequireStandard = false; + bool fMineBlocksOnDemand = false; + bool fTestnetToBeDeprecatedFieldRPC = false; Checkpoints::CCheckpointData checkpointData; std::vector vFoundersRewardAddress; }; diff --git a/src/chainparamsbase.h b/src/chainparamsbase.h index 4369d0aef..33765f0fc 100644 --- a/src/chainparamsbase.h +++ b/src/chainparamsbase.h @@ -29,7 +29,7 @@ public: protected: CBaseChainParams() {} - int nRPCPort; + int nRPCPort = 0; std::string strDataDir; }; diff --git a/src/policy/fees.h b/src/policy/fees.h index 15577d128..d37d4b184 100644 --- a/src/policy/fees.h +++ b/src/policy/fees.h @@ -66,6 +66,9 @@ class CTxMemPoolEntry; * they've been outstanding. */ +/** Decay of .998 is a half-life of 346 blocks or about 2.4 days */ +static const double DEFAULT_DECAY = .998; + /** * We will instantiate two instances of this class, one to track transactions * that were included in a block due to fee, and one for tx's included due to @@ -105,7 +108,7 @@ private: // Combine the total value with the tx counts to calculate the avg fee/priority per bucket std::string dataTypeString; - double decay; + double decay = DEFAULT_DECAY; // Mempool counts of outstanding transactions // For each bucket X, track the number of transactions in the mempool @@ -179,9 +182,6 @@ public: /** Track confirm delays up to 25 blocks, can't estimate beyond that */ static const unsigned int MAX_BLOCK_CONFIRMS = 25; -/** Decay of .998 is a half-life of 346 blocks or about 2.4 days */ -static const double DEFAULT_DECAY = .998; - /** Require greater than 85% of X fee transactions to be confirmed within Y blocks for X to be big enough */ static const double MIN_SUCCESS_PCT = .85; static const double UNLIKELY_PCT = .5; diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index f57ea240d..8ded62c7d 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -53,7 +53,7 @@ public: // These contain trapdoors, values and other information // that the recipient needs, including a memo field. It // is encrypted using the scheme implemented in crypto/NoteEncryption.cpp - boost::array ciphertexts; + boost::array ciphertexts = {{ {{0}} }}; // Random seed uint256 randomSeed; @@ -324,7 +324,7 @@ public: const uint32_t nLockTime; const std::vector vjoinsplit; const uint256 joinSplitPubKey; - const joinsplit_sig_t joinSplitSig; + const joinsplit_sig_t joinSplitSig = {{0}}; /** Construct a CTransaction that qualifies as IsNull() */ CTransaction(); @@ -403,7 +403,7 @@ struct CMutableTransaction uint32_t nLockTime; std::vector vjoinsplit; uint256 joinSplitPubKey; - CTransaction::joinsplit_sig_t joinSplitSig; + CTransaction::joinsplit_sig_t joinSplitSig = {{0}}; CMutableTransaction(); CMutableTransaction(const CTransaction& tx); diff --git a/src/txmempool.h b/src/txmempool.h index a6901fde6..e6fd8e60b 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -92,7 +92,7 @@ private: unsigned int nTransactionsUpdated; CBlockPolicyEstimator* minerPolicyEstimator; - uint64_t totalTxSize; //! sum of all mempool tx' byte sizes + uint64_t totalTxSize = 0; //! sum of all mempool tx' byte sizes public: mutable CCriticalSection cs; diff --git a/src/zcash/IncrementalMerkleTree.hpp b/src/zcash/IncrementalMerkleTree.hpp index 1d023168a..cd21bf651 100644 --- a/src/zcash/IncrementalMerkleTree.hpp +++ b/src/zcash/IncrementalMerkleTree.hpp @@ -163,7 +163,7 @@ private: IncrementalMerkleTree tree; std::vector filled; boost::optional> cursor; - size_t cursor_depth; + size_t cursor_depth = 0; std::deque partial_path() const; IncrementalWitness(IncrementalMerkleTree tree) : tree(tree) {} }; diff --git a/src/zcash/Note.hpp b/src/zcash/Note.hpp index 8cf53e5b4..460e68f9d 100644 --- a/src/zcash/Note.hpp +++ b/src/zcash/Note.hpp @@ -26,7 +26,7 @@ public: class NotePlaintext { public: - uint64_t value; + uint64_t value = 0; uint256 rho; uint256 r; boost::array memo;