Consensus stable faucet get constraint
This commit is contained in:
@@ -79,7 +79,7 @@ bool FaucetExactAmounts(struct CCcontract_info *cp,Eval* eval,const CTransaction
|
|||||||
|
|
||||||
bool FaucetValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx)
|
bool FaucetValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx)
|
||||||
{
|
{
|
||||||
int32_t numvins,numvouts,preventCCvins,preventCCvouts,i,j=0; bool retval; uint256 txid; uint8_t hash[32]; char str[65],destaddr[64];
|
int32_t numvins,numvouts,preventCCvins,preventCCvouts,i,numblocks; bool retval; uint256 txid; uint8_t hash[32]; char str[65],destaddr[64];
|
||||||
std::vector<std::pair<CAddressIndexKey, CAmount> > txids;
|
std::vector<std::pair<CAddressIndexKey, CAmount> > txids;
|
||||||
numvins = tx.vin.size();
|
numvins = tx.vin.size();
|
||||||
numvouts = tx.vout.size();
|
numvouts = tx.vout.size();
|
||||||
@@ -121,8 +121,8 @@ bool FaucetValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx
|
|||||||
SetCCtxids(txids,destaddr);
|
SetCCtxids(txids,destaddr);
|
||||||
for (std::vector<std::pair<CAddressIndexKey, CAmount> >::const_iterator it=txids.begin(); it!=txids.end(); it++)
|
for (std::vector<std::pair<CAddressIndexKey, CAmount> >::const_iterator it=txids.begin(); it!=txids.end(); it++)
|
||||||
{
|
{
|
||||||
if ( ++j > 1 )
|
if ( CCduration(numblocks,it->first.txhash) > 0 && numblocks > 3 )
|
||||||
return eval->Invalid("faucet is only for unused addresses");
|
return eval->Invalid("faucet is only for brand new addresses");
|
||||||
}
|
}
|
||||||
retval = PreventCC(eval,tx,preventCCvins,numvins,preventCCvouts,numvouts);
|
retval = PreventCC(eval,tx,preventCCvins,numvins,preventCCvouts,numvouts);
|
||||||
if ( retval != 0 )
|
if ( retval != 0 )
|
||||||
|
|||||||
Reference in New Issue
Block a user