From 394b00366e05193a4e98cc0d1c8f79acfa091f5a Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Thu, 28 Mar 2019 20:34:55 +0800 Subject: [PATCH] fixed! --- src/cc/rewards.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc/rewards.cpp b/src/cc/rewards.cpp index 152842bbd..bc9464fb8 100644 --- a/src/cc/rewards.cpp +++ b/src/cc/rewards.cpp @@ -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) ) return eval->Invalid("txfee is too high"); + amount = vinTx.vout[0].nValue; reward = RewardsCalc(amount,tx.vin[0].prevout.hash,APR,minseconds,maxseconds,mindeposit); 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 ( 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"); else if ( tx.vout[1].scriptPubKey != vinTx.vout[1].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 ) return false; else if ( tx.vout[1].nValue > amount+reward )