From de646890858f06a30fe72ed2ec97e53c5e27e590 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Thu, 28 Mar 2019 14:45:34 +0800 Subject: [PATCH] fix rewards minrelease validation --- src/cc/rewards.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cc/rewards.cpp b/src/cc/rewards.cpp index 73f723453..129cbc47f 100644 --- a/src/cc/rewards.cpp +++ b/src/cc/rewards.cpp @@ -258,11 +258,11 @@ 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"); reward = RewardsCalc(amount,tx.vin[0].prevout.hash,APR,minseconds,maxseconds,mindeposit); + if ( reward == 0 ) + return eval->Invalid("no elegible rewards"); if ( numvins == 1 && tx.vout[0].scriptPubKey.IsPayToCryptoCondition() == 0 ) { - if ( reward == 0 ) - return eval->Invalid("unlock recover no rewards"); - else if ( tx.vout[1].nValue != 10000 ) + if ( tx.vout[1].nValue != 10000 ) return eval->Invalid("wrong marker vour value"); else if ( tx.vout[1].scriptPubKey != tx.vout[0].scriptPubKey ) return eval->Invalid("unlock recover tx vout.1 mismatched scriptPubKey");