This commit is contained in:
jl777
2018-09-19 21:09:27 -11:00
parent f44cd67e82
commit bfd7858525

View File

@@ -71,7 +71,7 @@ int64_t PricesOraclePrice(int64_t &rektprice,uint64_t mode,uint256 oracletxid,st
return(price); return(price);
} }
CScript EncodePricesFundingOpRet(uint8_t funcid,CPubKey planpk,uint256 oracletxid,uint256 longtoken,uint256 shorttoken,int32_t millimargin,uint64_t mode,int32_t maxleverage,std::vector<CPubKey> pubkeys) CScript EncodePricesFundingOpRet(uint8_t funcid,CPubKey planpk,uint256 oracletxid,uint256 longtoken,uint256 shorttoken,int32_t millimargin,uint64_t mode,int32_t maxleverage,std::vector<CPubKey> pubkeys,uint256 bettoken)
{ {
CScript opret; CScript opret;
fprintf(stderr,"implement EncodePricesFundingOpRet\n"); fprintf(stderr,"implement EncodePricesFundingOpRet\n");
@@ -104,12 +104,12 @@ bool PricesValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx
} }
} }
//fprintf(stderr,"check amounts\n"); //fprintf(stderr,"check amounts\n");
if ( PricesExactAmounts(cp,eval,tx,1,10000) == false ) //if ( PricesExactAmounts(cp,eval,tx,1,10000) == false )
{ {
fprintf(stderr,"Pricesget invalid amount\n"); fprintf(stderr,"Pricesget invalid amount\n");
return false; return false;
} }
else //else
{ {
txid = tx.GetHash(); txid = tx.GetHash();
memcpy(hash,&txid,sizeof(hash)); memcpy(hash,&txid,sizeof(hash));
@@ -135,10 +135,10 @@ int64_t AddTokensInputs(struct CCcontract_info *cp,CMutableTransaction &mtx,char
txid = it->first.txhash; txid = it->first.txhash;
vout = (int32_t)it->first.index; vout = (int32_t)it->first.index;
// need to prevent dup // need to prevent dup
if ( GetTransaction(txid,vintx,hashBlock,false) != 0 && vout < tx.vout.size() ) if ( GetTransaction(txid,vintx,hashBlock,false) != 0 && vout < vintx.vout.size() )
{ {
// need to verify assetid // need to verify assetid
if ( (nValue= vintx.vout[vout].nValue)) > 10000 && myIsutxo_spentinmempool(txid,vout) == 0 ) if ( (nValue= vintx.vout[vout].nValue) > 10000 && myIsutxo_spentinmempool(txid,vout) == 0 )
{ {
if ( total != 0 && maxinputs != 0 ) if ( total != 0 && maxinputs != 0 )
mtx.vin.push_back(CTxIn(txid,vout,CScript())); mtx.vin.push_back(CTxIn(txid,vout,CScript()));
@@ -208,7 +208,7 @@ std::string PricesCreateFunding(uint64_t txfee,uint256 bettoken,uint256 oracletx
} }
if ( GetCCaddress1of2(houseaddr,cp,pricespk,mypk) == 0 ) if ( GetCCaddress1of2(houseaddr,cp,pricespk,mypk) == 0 )
{ {
fprintf(stderr,"PricesCreateFunding (%s) cant create globaladdr\n",uint256_str(str,tokenid)); fprintf(stderr,"PricesCreateFunding cant create globaladdr\n");
return(""); return("");
} }
if ( CCtoken_balance(houseaddr,longtoken) != CCfullsupply(longtoken) ) if ( CCtoken_balance(houseaddr,longtoken) != CCfullsupply(longtoken) )