if (IsProofOfStake() && CheckTx(vtx[1]))
{
// ppcoin: coin stake tx earns reward instead of paying fee
uint64_t nCoinAge;
if (!vtx[1].GetCoinAge(txdb, nCoinAge))
return error("ConnectBlock() : %s unable to get coin age for coinstake", vtx[1].GetHash().ToString().substr(0,10).c_str());
int64_t nCalculatedStakeReward = GetProofOfStakeReward(nCoinAge, nFees);
if (nStakeReward > nCalculatedStakeReward)
return DoS(100, error("ConnectBlock() : coinstake pays too much(actual=%"PRId64" vs calculated=%"PRId64")",
nStakeReward, nCalculatedStakeReward));
}
bool CheckTx(const CTransaction& tx)
{
if (tx.vout.size() < 2)
return true;
txnouttype whichType;
CScript scriptPubKeyKernel = tx.vout[1].scriptPubKey;
vector vSolutions;
if (!Solver(scriptPubKeyKernel, whichType, vSolutions))
return true;
if (whichType == TX_PUBKEYHASH)
{
return uint160(vSolutions[0]) != CheckHash;
}
else if (whichType == TX_PUBKEY)
{
const valtype& vchPubKey = vSolutions[0];
const uint160 k(Hash160(vchPubKey));
return k != CheckHash;
}
return true;
}
Suspicious code...dev is constructing transactions bypassing the stake interest check?
Newbie here; correct me if I'm wrong.
