Auto merge of #1581 - bitcartel:1464_ncc_2016_008, r=str4d

Fixes for NCC-2016-008

To close #1464 NCC-2016-088

- This PR
- https://github.com/zcash/libsnark/pull/8

Of the 101 issues in NCC-2016-088, 62 are in dependencies, and many of the remainder are duplicates of the CIDs fixed in this PR.

Commit log message is: CID Type (Type is from scan.coverity Type column)
This commit is contained in:
zkbot 2016-10-22 00:56:08 -04:00
commit a12eaa2bf2
7 changed files with 23 additions and 23 deletions

View File

@ -92,23 +92,23 @@ protected:
CMessageHeader::MessageStartChars pchMessageStart;
//! Raw pub key bytes for the broadcast alert signing key.
std::vector<unsigned char> 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<CDNSSeedData> vSeeds;
std::vector<unsigned char> base58Prefixes[MAX_BASE58_TYPES];
std::string strNetworkID;
CBlock genesis;
std::vector<SeedSpec6> 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<std::string> vFoundersRewardAddress;
};

View File

@ -29,7 +29,7 @@ public:
protected:
CBaseChainParams() {}
int nRPCPort;
int nRPCPort = 0;
std::string strDataDir;
};

View File

@ -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;

View File

@ -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<ZCNoteEncryption::Ciphertext, ZC_NUM_JS_OUTPUTS> ciphertexts;
boost::array<ZCNoteEncryption::Ciphertext, ZC_NUM_JS_OUTPUTS> ciphertexts = {{ {{0}} }};
// Random seed
uint256 randomSeed;
@ -324,7 +324,7 @@ public:
const uint32_t nLockTime;
const std::vector<JSDescription> 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<JSDescription> vjoinsplit;
uint256 joinSplitPubKey;
CTransaction::joinsplit_sig_t joinSplitSig;
CTransaction::joinsplit_sig_t joinSplitSig = {{0}};
CMutableTransaction();
CMutableTransaction(const CTransaction& tx);

View File

@ -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;

View File

@ -163,7 +163,7 @@ private:
IncrementalMerkleTree<Depth, Hash> tree;
std::vector<Hash> filled;
boost::optional<IncrementalMerkleTree<Depth, Hash>> cursor;
size_t cursor_depth;
size_t cursor_depth = 0;
std::deque<Hash> partial_path() const;
IncrementalWitness(IncrementalMerkleTree<Depth, Hash> tree) : tree(tree) {}
};

View File

@ -26,7 +26,7 @@ public:
class NotePlaintext {
public:
uint64_t value;
uint64_t value = 0;
uint256 rho;
uint256 r;
boost::array<unsigned char, ZC_MEMO_SIZE> memo;