PIVX Core  5.6.99
P2P Digital Currency
zpos.h
Go to the documentation of this file.
1 // Copyright (c) 2020-2021 The PIVX Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef PIVX_ZPIV_ZPOS_H
6 #define PIVX_ZPIV_ZPOS_H
7 
8 #include "stakeinput.h"
9 #include "txdb.h"
10 
12 {
13 private:
14  uint32_t nChecksum{0};
17 
18 public:
19  CLegacyZPivStake(const CBlockIndex* _pindexFrom, uint32_t _nChecksum, libzerocoin::CoinDenomination _denom, const uint256& _hashSerial) :
20  CStakeInput(_pindexFrom),
21  nChecksum(_nChecksum),
22  denom(_denom),
23  hashSerial(_hashSerial)
24  {}
25 
26  static CLegacyZPivStake* NewZPivStake(const CTxIn& txin, int nHeight);
27 
28  bool IsZPIV() const override { return true; }
29  uint32_t GetChecksum() const { return nChecksum; }
30  const CBlockIndex* GetIndexFrom() const override;
31  CAmount GetValue() const override;
32  CDataStream GetUniqueness() const override;
33  bool GetTxOutFrom(CTxOut& out) const override { return false; /* not available */ }
34 };
35 
36 #endif // PIVX_ZPIV_ZPOS_H
int64_t CAmount
Amount in PIV (Can be negative)
Definition: amount.h:13
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition: chain.h:139
CDataStream GetUniqueness() const override
Definition: zpos.cpp:113
const CBlockIndex * GetIndexFrom() const override
Definition: zpos.cpp:103
uint32_t GetChecksum() const
Definition: zpos.h:29
libzerocoin::CoinDenomination denom
Definition: zpos.h:15
bool GetTxOutFrom(CTxOut &out) const override
Definition: zpos.h:33
bool IsZPIV() const override
Definition: zpos.h:28
uint32_t nChecksum
Definition: zpos.h:14
static CLegacyZPivStake * NewZPivStake(const CTxIn &txin, int nHeight)
Definition: zpos.cpp:58
uint256 hashSerial
Definition: zpos.h:16
CAmount GetValue() const override
Definition: zpos.cpp:108
CLegacyZPivStake(const CBlockIndex *_pindexFrom, uint32_t _nChecksum, libzerocoin::CoinDenomination _denom, const uint256 &_hashSerial)
Definition: zpos.h:19
An input of a transaction.
Definition: transaction.h:94
An output of a transaction.
Definition: transaction.h:137
256-bit opaque blob.
Definition: uint256.h:138
const uint256 UINT256_ZERO
constant uint256 instances
Definition: uint256.h:175