extern CCriticalSection cs_main;
extern std::map<uint256, CBlockIndex*> mapBlockIndex;
+extern std::set<COutPoint> setStakeSeen;
extern uint256 hashGenesisBlock;
extern CBlockIndex* pindexGenesisBlock;
extern int nBestHeight;
bool IsCoinStake() const
{
// ppcoin: the coin stake transaction is marked with the first output empty
- return (vout.size() == 2 && vout[0].IsEmpty());
+ return (vin.size() > 0 && vout.size() == 2 && vout[0].IsEmpty());
}
int GetSigOpCount() const
int nHeight;
int nCheckpoint; // ppcoin: chain auto checkpoint height
bool fProofOfStake; // ppcoin: is the block of proof-of-stake type
+ COutPoint prevoutStake;
// block header
int nVersion;
nChainTrust = 0;
nCheckpoint = 0;
fProofOfStake = true;
+ prevoutStake.SetNull();
nVersion = 0;
hashMerkleRoot = 0;
nChainTrust = 0;
nCheckpoint = 0;
fProofOfStake = block.IsProofOfStake();
+ if (fProofOfStake)
+ prevoutStake = block.vtx[1].vin[0].prevout;
+ else
+ prevoutStake.SetNull();
nVersion = block.nVersion;
hashMerkleRoot = block.hashMerkleRoot;
READWRITE(nHeight);
READWRITE(nCheckpoint);
READWRITE(fProofOfStake);
+ READWRITE(prevoutStake);
// block header
READWRITE(this->nVersion);