Merge remote-tracking branch 'origin/jl777' into cctests
This commit is contained in:
@@ -266,7 +266,7 @@ int64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,int64_t total,int3
|
|||||||
{
|
{
|
||||||
txid = out.tx->GetHash();
|
txid = out.tx->GetHash();
|
||||||
vout = out.i;
|
vout = out.i;
|
||||||
if ( GetTransaction(txid,tx,hashBlock,false) != 0 && tx.vout.size() > 0 && tx.vout[vout].scriptPubKey.IsPayToCryptoCondition() == 0 )
|
if ( GetTransaction(txid,tx,hashBlock,false) != 0 && tx.vout.size() > 0 && vout < tx.vout.size() && tx.vout[vout].scriptPubKey.IsPayToCryptoCondition() == 0 )
|
||||||
{
|
{
|
||||||
if ( mtx.vin.size() > 0 )
|
if ( mtx.vin.size() > 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -243,9 +243,7 @@ bool RewardsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &t
|
|||||||
if ( (*cp->ismyvin)(tx.vin[i].scriptSig) == 0 )
|
if ( (*cp->ismyvin)(tx.vin[i].scriptSig) == 0 )
|
||||||
return eval->Invalid("unexpected normal vin for unlock");
|
return eval->Invalid("unexpected normal vin for unlock");
|
||||||
}
|
}
|
||||||
if ( RewardsExactAmounts(cp,eval,tx,txfee+tx.vout[1].nValue,sbits,fundingtxid) == 0 )
|
if ( eval->GetTxUnconfirmed(tx.vin[0].prevout.hash,vinTx,hashBlock) == 0 )
|
||||||
return false;
|
|
||||||
else if ( eval->GetTxUnconfirmed(tx.vin[0].prevout.hash,vinTx,hashBlock) == 0 )
|
|
||||||
return eval->Invalid("always should find vin.0, but didnt");
|
return eval->Invalid("always should find vin.0, but didnt");
|
||||||
else if ( vinTx.vout[0].scriptPubKey.IsPayToCryptoCondition() == 0 )
|
else if ( vinTx.vout[0].scriptPubKey.IsPayToCryptoCondition() == 0 )
|
||||||
return eval->Invalid("lock tx vout.0 is normal output");
|
return eval->Invalid("lock tx vout.0 is normal output");
|
||||||
@@ -259,7 +257,9 @@ bool RewardsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &t
|
|||||||
return eval->Invalid("unlock tx vout.1 mismatched scriptPubKey");
|
return eval->Invalid("unlock tx vout.1 mismatched scriptPubKey");
|
||||||
amount = vinTx.vout[0].nValue;
|
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 ( tx.vout[1].nValue > amount+reward )
|
if ( RewardsExactAmounts(cp,eval,tx,txfee+tx.vout[1].nValue+reward,sbits,fundingtxid) == 0 )
|
||||||
|
return false;
|
||||||
|
else if ( tx.vout[1].nValue > amount+reward )
|
||||||
return eval->Invalid("unlock tx vout.1 isnt amount+reward");
|
return eval->Invalid("unlock tx vout.1 isnt amount+reward");
|
||||||
preventCCvouts = 1;
|
preventCCvouts = 1;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1535,8 +1535,6 @@ int32_t komodo_checkPOW(int32_t slowflag,CBlock *pblock,int32_t height)
|
|||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( strcmp(ASSETCHAINS_SYMBOL,"MGNX") == 0 && height < 13000 )
|
|
||||||
return(0);
|
|
||||||
if ( ASSETCHAINS_STAKED != 0 && height >= 2 ) // must PoS or have at least 16x better PoW
|
if ( ASSETCHAINS_STAKED != 0 && height >= 2 ) // must PoS or have at least 16x better PoW
|
||||||
{
|
{
|
||||||
if ( (is_PoSblock= komodo_is_PoSblock(slowflag,height,pblock,bnTarget,bhash)) == 0 )
|
if ( (is_PoSblock= komodo_is_PoSblock(slowflag,height,pblock,bnTarget,bhash)) == 0 )
|
||||||
|
|||||||
Reference in New Issue
Block a user