fixed!
This commit is contained in:
@@ -257,9 +257,10 @@ bool RewardsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &t
|
|||||||
}
|
}
|
||||||
if ( !CheckTxFee(tx, txfee, chainActive.LastTip()->GetHeight(), chainActive.LastTip()->nTime) )
|
if ( !CheckTxFee(tx, txfee, chainActive.LastTip()->GetHeight(), chainActive.LastTip()->nTime) )
|
||||||
return eval->Invalid("txfee is too high");
|
return eval->Invalid("txfee is too high");
|
||||||
|
amount = vinTx.vout[0].nValue;
|
||||||
reward = RewardsCalc(amount,tx.vin[0].prevout.hash,APR,minseconds,maxseconds,mindeposit);
|
reward = RewardsCalc(amount,tx.vin[0].prevout.hash,APR,minseconds,maxseconds,mindeposit);
|
||||||
if ( reward == 0 )
|
if ( reward == 0 )
|
||||||
return eval->Invalid("no elegible rewards");
|
return eval->Invalid("no eligible rewards");
|
||||||
if ( numvins == 1 && tx.vout[0].scriptPubKey.IsPayToCryptoCondition() == 0 )
|
if ( numvins == 1 && tx.vout[0].scriptPubKey.IsPayToCryptoCondition() == 0 )
|
||||||
{
|
{
|
||||||
if ( tx.vout[1].nValue != 10000 )
|
if ( tx.vout[1].nValue != 10000 )
|
||||||
@@ -284,7 +285,6 @@ bool RewardsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &t
|
|||||||
return eval->Invalid("unlock tx vout.1 is CC output");
|
return eval->Invalid("unlock tx vout.1 is CC output");
|
||||||
else if ( tx.vout[1].scriptPubKey != vinTx.vout[1].scriptPubKey )
|
else if ( tx.vout[1].scriptPubKey != vinTx.vout[1].scriptPubKey )
|
||||||
return eval->Invalid("unlock tx vout.1 mismatched scriptPubKey");
|
return eval->Invalid("unlock tx vout.1 mismatched scriptPubKey");
|
||||||
amount = vinTx.vout[0].nValue;
|
|
||||||
if ( RewardsExactAmounts(cp,eval,tx,txfee+tx.vout[1].nValue,sbits,fundingtxid) == 0 )
|
if ( RewardsExactAmounts(cp,eval,tx,txfee+tx.vout[1].nValue,sbits,fundingtxid) == 0 )
|
||||||
return false;
|
return false;
|
||||||
else if ( tx.vout[1].nValue > amount+reward )
|
else if ( tx.vout[1].nValue > amount+reward )
|
||||||
|
|||||||
Reference in New Issue
Block a user