11 static bool HasStakeMinAgeOrDepth(
int nHeight, uint32_t nTime,
const CBlockIndex* pindex)
16 return error(
"%s : min age violation - height=%d - time=%d, nHeightBlockFrom=%d, nTimeBlockFrom=%d",
17 __func__, nHeight, nTime, pindex->
nHeight, pindex->
nTime);
25 error(
"%s: unable to initialize CPivStake from zerocoin spend", __func__);
34 if (!HasStakeMinAgeOrDepth(nHeight, nTime,
pindexFrom)) {
55 error(
"%s : Failed to find the block index for stake origin", __func__);
59 if (!HasStakeMinAgeOrDepth(nHeight, nTime,
pindexFrom)) {
94 if (!
pindexFrom)
throw std::runtime_error(
"CPivStake: uninitialized pindexFrom");
int64_t CAmount
Amount in PIV (Can be negative)
const CChainParams & Params()
Return the currently selected parameters.
The block chain is a tree shaped structure starting with the genesis block at the root,...
int nHeight
height of the entry in the chain. The genesis block has height 0
bool Contains(const CBlockIndex *pindex) const
Efficiently check whether a block is present in this chain.
const Consensus::Params & GetConsensus() const
const CBlockIndex * GetIndexFrom() const override
bool GetTxOutFrom(CTxOut &out) const override
CAmount GetValue() const override
const COutPoint outpointFrom
CDataStream GetUniqueness() const override
static CPivStake * NewPivStake(const CTxIn &txin, int nHeight, uint32_t nTime)
CPivStake(const CTxOut &_from, const COutPoint &_outPointFrom, const CBlockIndex *_pindexFrom)
An input of a transaction.
bool IsZerocoinSpend() const
An output of a transaction.
CTxOut out
unspent transaction output
uint32_t nHeight
at which height the containing transaction was included in the active block chain
std::string GetHex() const
Parameters that influence chain consensus.
bool HasStakeMinAgeOrDepth(const int contextHeight, const uint32_t contextTime, const int utxoFromBlockHeight, const uint32_t utxoFromBlockTime) const
bool NetworkUpgradeActive(int nHeight, Consensus::UpgradeIndex idx) const
Returns true if the given network upgrade is active as of the given block height.
bool error(const char *fmt, const Args &... args)
std::shared_ptr< const CTransaction > CTransactionRef
bool GetTransaction(const uint256 &hash, CTransactionRef &txOut, uint256 &hashBlock, bool fAllowSlow, CBlockIndex *blockIndex)
Return transaction in tx, and if it was found inside a block, its hash is placed in hashBlock.
std::unique_ptr< CCoinsViewCache > pcoinsTip
Global variable that points to the active CCoinsView (protected by cs_main)
CChain chainActive
The currently-connected chain of blocks (protected by cs_main).