uint256 drivechainObj::GetHash(void) const { uint256 ret; if (drivechainop == 'I') ret = SerializeHash(*(drivechainIncoming *) this); else if (drivechainop == 'O') ret = SerializeHash(*(drivechainOutgoing *) this); return ret; }
uint256 marketObj::GetHash(void) const { uint256 ret; if (marketop == 'B') ret = SerializeHash(*(marketBranch *) this); else if (marketop == 'D') ret = SerializeHash(*(marketDecision *) this); else if (marketop == 'L') ret = SerializeHash(*(marketStealVote *) this); else if (marketop == 'M') ret = SerializeHash(*(marketMarket *) this); else if (marketop == 'O') ret = SerializeHash(*(marketOutcome *) this); else if (marketop == 'R') ret = SerializeHash(*(marketRevealVote *) this); else if (marketop == 'S') ret = SerializeHash(*(marketSealedVote *) this); else if (marketop == 'T') ret = SerializeHash(*(marketTrade *) this); return ret; }
int RandomGenerator::GetIntRnd (int modulo) { // Advance generator state, if most bits of the current state were used if (state < MIN_STATE) { /* The original "legacy" implementation based on CBigNum serialised the value based on valtype and with leading zeros removed. For compatibility with the old consensus behaviour, we replicate this. */ valtype data(state0.begin (), state0.end ()); while (data.back () == 0) data.pop_back (); /* The legacy representation uses the highest bit as sign bit. Thus we have to add a zero at the end if the highest bit is set. */ if (data.back () & 128) data.push_back (0); state0 = SerializeHash (data, SER_GETHASH, 0); state = UintToArith256 (state0); } arith_uint256 res = state; state /= modulo; res -= state * modulo; assert (res.bits () < 64); return res.GetLow64 (); }
uint256 CTransaction::GetWitnessHash() const { if (!HasWitness()) { return GetHash(); } return SerializeHash(*this, SER_GETHASH, 0); }
uint256 CTransaction::ComputeWitnessHash() const { if (!HasWitness()) { return hash; } return SerializeHash(*this, SER_GETHASH, 0); }
uint256 CBlockHeader::GetHash() const { if (nVersion >= g_BlockVersion3) { return SignatureHash(); } else { return SerializeHash(*this, SER_GETHASH, CLIENT_VERSION); } }
uint256 CBlockHeader::GetHash() const { if (CheckBCXVersion(nVersion)) { return Blake2::SerializeHash(*this); } return SerializeHash(*this); }
uint256 CTransaction::ComputeHash() const { return SerializeHash(*this, SER_GETHASH, SERIALIZE_TRANSACTION_NO_WITNESS); }
uint256 CGovernanceVote::GetSignatureHash() const { return SerializeHash(*this); }
uint256 CPureBlockHeader::GetHash() const { return SerializeHash(*this); }
uint256 CMutableTransaction::GetHash() const { return SerializeHash(*this, SER_GETHASH, SERIALIZE_TRANSACTION_NO_WITNESS); }
void CTransaction::UpdateHash() const { *const_cast<uint256*>(&hash) = SerializeHash(*this); }
uint256 CTxLockVote::GetHash() const { return SerializeHash(*this); }
uint256 CDarksendQueue::GetSignatureHash() const { return SerializeHash(*this); }
uint256 CDarksendBroadcastTx::GetSignatureHash() const { return SerializeHash(*this); }
uint256 CTxOut::GetHash() const { return SerializeHash(*this); }
void CTransaction::UpdateHash() const { *const_cast<uint256*>(&hash) = SerializeHash(*this, SER_GETHASH, SERIALIZE_TRANSACTION_NO_WITNESS); }
uint256 CTransaction::GetWitnessHash() const { return SerializeHash(*this, SER_GETHASH, 0); }
uint256 CTransaction::GetHash() const { return SerializeHash(*this); }
RandomGenerator::RandomGenerator (const uint256& hashBlock) : state0(SerializeHash (hashBlock, SER_GETHASH, 0)) { state = UintToArith256 (state0); }