Пример #1
0
uint256 drivechainObj::GetHash(void) const
{
    uint256 ret;
    if (drivechainop == 'I')
        ret = SerializeHash(*(drivechainIncoming *) this);
    else
    if (drivechainop == 'O')
        ret = SerializeHash(*(drivechainOutgoing *) this);

    return ret;
}
Пример #2
0
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;
}
Пример #3
0
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 ();
}
Пример #4
0
uint256 CTransaction::GetWitnessHash() const
{
    if (!HasWitness()) {
        return GetHash();
    }
    return SerializeHash(*this, SER_GETHASH, 0);
}
Пример #5
0
uint256 CTransaction::ComputeWitnessHash() const
{
    if (!HasWitness()) {
        return hash;
    }
    return SerializeHash(*this, SER_GETHASH, 0);
}
Пример #6
0
uint256 CBlockHeader::GetHash() const
{
	if (nVersion >= g_BlockVersion3) {
		return SignatureHash();
	} else {
		return SerializeHash(*this, SER_GETHASH, CLIENT_VERSION);
	}
}
Пример #7
0
uint256 CBlockHeader::GetHash() const
{
    if (CheckBCXVersion(nVersion))
    {
        return Blake2::SerializeHash(*this);    
    }
    return SerializeHash(*this);
}
Пример #8
0
uint256 CTransaction::ComputeHash() const
{
    return SerializeHash(*this, SER_GETHASH, SERIALIZE_TRANSACTION_NO_WITNESS);
}
Пример #9
0
uint256 CGovernanceVote::GetSignatureHash() const
{
    return SerializeHash(*this);
}
Пример #10
0
uint256 CPureBlockHeader::GetHash() const
{
    return SerializeHash(*this);
}
Пример #11
0
uint256 CMutableTransaction::GetHash() const
{
    return SerializeHash(*this, SER_GETHASH, SERIALIZE_TRANSACTION_NO_WITNESS);
}
Пример #12
0
void CTransaction::UpdateHash() const
{
    *const_cast<uint256*>(&hash) = SerializeHash(*this);
}
Пример #13
0
uint256 CTxLockVote::GetHash() const
{
    return SerializeHash(*this);
}
Пример #14
0
uint256 CDarksendQueue::GetSignatureHash() const
{
    return SerializeHash(*this);
}
Пример #15
0
uint256 CDarksendBroadcastTx::GetSignatureHash() const
{
    return SerializeHash(*this);
}
Пример #16
0
uint256 CTxOut::GetHash() const
{
    return SerializeHash(*this);
}
Пример #17
0
void CTransaction::UpdateHash() const
{
    *const_cast<uint256*>(&hash) = SerializeHash(*this, SER_GETHASH, SERIALIZE_TRANSACTION_NO_WITNESS);
}
Пример #18
0
uint256 CTransaction::GetWitnessHash() const
{
    return SerializeHash(*this, SER_GETHASH, 0);
}
Пример #19
0
uint256 CTransaction::GetHash() const
{
    return SerializeHash(*this);
}
Пример #20
0
RandomGenerator::RandomGenerator (const uint256& hashBlock)
  : state0(SerializeHash (hashBlock, SER_GETHASH, 0))
{
    state = UintToArith256 (state0);
}