Skip to content

Commit

Permalink
mrc: zero initialize primitives
Browse files Browse the repository at this point in the history
Rationale:
    Avoids an UB in it_rejects_invalid_claims MRC test.
  • Loading branch information
div72 committed Dec 24, 2023
1 parent c01ba5d commit a79368b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gridcoin/mrc.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ class MRC : public IContractPayload
//! incoming reward claims and can index those calculated values without
//! this field. It can be considered informational.
//!
CAmount m_research_subsidy;
CAmount m_research_subsidy = 0;

//!
//! \brief The value of the fees charged to the MRC claimant. These will be
//! subtracted from the research subsidy and distributed to the staker and
//! the foundation according to protocol rules encapsulated in ComputeMRCFee().
//!
CAmount m_fee;
CAmount m_fee = 0;

//!
//! \brief The researcher magnitude value from the superblock at the time
Expand All @@ -145,14 +145,14 @@ class MRC : public IContractPayload
//!
//! Previous protocol versions used the magnitude in reward calculations.
//!
uint16_t m_magnitude;
uint16_t m_magnitude = 0;

//!
//! \brief The magnitude ratio of the network at the time of the claim.
//!
//! Informational.
//!
double m_magnitude_unit;
double m_magnitude_unit = 0.0;

//!
//! \brief The hash of the last block (head of the chain) for the MRC
Expand Down

0 comments on commit a79368b

Please sign in to comment.