Disable assets swap
This commit is contained in:
@@ -305,6 +305,8 @@ std::string CreateSell(int64_t txfee,int64_t askamount,uint256 assetid,int64_t p
|
|||||||
std::string CreateSwap(int64_t txfee,int64_t askamount,uint256 assetid,uint256 assetid2,int64_t pricetotal)
|
std::string CreateSwap(int64_t txfee,int64_t askamount,uint256 assetid,uint256 assetid2,int64_t pricetotal)
|
||||||
{
|
{
|
||||||
CMutableTransaction mtx; CPubKey mypk; uint64_t mask; int64_t inputs,CCchange; CScript opret; struct CCcontract_info *cp,C;
|
CMutableTransaction mtx; CPubKey mypk; uint64_t mask; int64_t inputs,CCchange; CScript opret; struct CCcontract_info *cp,C;
|
||||||
|
fprintf(stderr,"asset swaps disabled\n");
|
||||||
|
return(0);
|
||||||
if ( askamount < 0 || pricetotal < 0 )
|
if ( askamount < 0 || pricetotal < 0 )
|
||||||
{
|
{
|
||||||
fprintf(stderr,"negative askamount %lld, askamount %lld\n",(long long)pricetotal,(long long)askamount);
|
fprintf(stderr,"negative askamount %lld, askamount %lld\n",(long long)pricetotal,(long long)askamount);
|
||||||
@@ -429,6 +431,12 @@ std::string FillSell(int64_t txfee,uint256 assetid,uint256 assetid2,uint256 askt
|
|||||||
fprintf(stderr,"negative fillunits %lld\n",(long long)fillunits);
|
fprintf(stderr,"negative fillunits %lld\n",(long long)fillunits);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
if ( assetid2 != zeroid )
|
||||||
|
{
|
||||||
|
fprintf(stderr,"asset swaps disabled\n");
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
cp = CCinit(&C,EVAL_ASSETS);
|
cp = CCinit(&C,EVAL_ASSETS);
|
||||||
if ( txfee == 0 )
|
if ( txfee == 0 )
|
||||||
txfee = 10000;
|
txfee = 10000;
|
||||||
|
|||||||
@@ -250,9 +250,9 @@ bool AssetsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx
|
|||||||
}
|
}
|
||||||
fprintf(stderr,"fillbuy validated\n");
|
fprintf(stderr,"fillbuy validated\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 's': // selloffer
|
|
||||||
case 'e': // selloffer
|
case 'e': // selloffer
|
||||||
|
break; // disable swaps
|
||||||
|
case 's': // selloffer
|
||||||
//vin.0: normal input
|
//vin.0: normal input
|
||||||
//vin.1+: valid CC output for sale
|
//vin.1+: valid CC output for sale
|
||||||
//vout.0: vin.1 assetoshis output to CC to unspendable
|
//vout.0: vin.1 assetoshis output to CC to unspendable
|
||||||
@@ -323,6 +323,7 @@ bool AssetsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx
|
|||||||
fprintf(stderr,"fill validated\n");
|
fprintf(stderr,"fill validated\n");
|
||||||
break;
|
break;
|
||||||
case 'E': // fillexchange
|
case 'E': // fillexchange
|
||||||
|
break; // disable asset swaps
|
||||||
//vin.0: normal input
|
//vin.0: normal input
|
||||||
//vin.1: unspendable.(vout.0 assetoshis from selloffer) sellTx.vout[0]
|
//vin.1: unspendable.(vout.0 assetoshis from selloffer) sellTx.vout[0]
|
||||||
//vin.2+: valid CC assetid2 output that satisfies exchange (*tx.vin[2])->nValue
|
//vin.2+: valid CC assetid2 output that satisfies exchange (*tx.vin[2])->nValue
|
||||||
|
|||||||
@@ -393,10 +393,10 @@ static const CRPCCommand vRPCCommands[] =
|
|||||||
{ "tokens", "tokencancelbid", &tokencancelbid, true },
|
{ "tokens", "tokencancelbid", &tokencancelbid, true },
|
||||||
{ "tokens", "tokenfillbid", &tokenfillbid, true },
|
{ "tokens", "tokenfillbid", &tokenfillbid, true },
|
||||||
{ "tokens", "tokenask", &tokenask, true },
|
{ "tokens", "tokenask", &tokenask, true },
|
||||||
{ "tokens", "tokenswapask", &tokenswapask, true },
|
//{ "tokens", "tokenswapask", &tokenswapask, true },
|
||||||
{ "tokens", "tokencancelask", &tokencancelask, true },
|
{ "tokens", "tokencancelask", &tokencancelask, true },
|
||||||
{ "tokens", "tokenfillask", &tokenfillask, true },
|
{ "tokens", "tokenfillask", &tokenfillask, true },
|
||||||
{ "tokens", "tokenfillswap", &tokenfillswap, true },
|
//{ "tokens", "tokenfillswap", &tokenfillswap, true },
|
||||||
|
|
||||||
/* Address index */
|
/* Address index */
|
||||||
{ "addressindex", "getaddressmempool", &getaddressmempool, true },
|
{ "addressindex", "getaddressmempool", &getaddressmempool, true },
|
||||||
|
|||||||
@@ -221,8 +221,8 @@ extern UniValue tokenfillbid(const UniValue& params, bool fHelp);
|
|||||||
extern UniValue tokenask(const UniValue& params, bool fHelp);
|
extern UniValue tokenask(const UniValue& params, bool fHelp);
|
||||||
extern UniValue tokencancelask(const UniValue& params, bool fHelp);
|
extern UniValue tokencancelask(const UniValue& params, bool fHelp);
|
||||||
extern UniValue tokenfillask(const UniValue& params, bool fHelp);
|
extern UniValue tokenfillask(const UniValue& params, bool fHelp);
|
||||||
extern UniValue tokenswapask(const UniValue& params, bool fHelp);
|
//extern UniValue tokenswapask(const UniValue& params, bool fHelp);
|
||||||
extern UniValue tokenfillswap(const UniValue& params, bool fHelp);
|
//extern UniValue tokenfillswap(const UniValue& params, bool fHelp);
|
||||||
extern UniValue faucetfund(const UniValue& params, bool fHelp);
|
extern UniValue faucetfund(const UniValue& params, bool fHelp);
|
||||||
extern UniValue faucetget(const UniValue& params, bool fHelp);
|
extern UniValue faucetget(const UniValue& params, bool fHelp);
|
||||||
extern UniValue faucetaddress(const UniValue& params, bool fHelp);
|
extern UniValue faucetaddress(const UniValue& params, bool fHelp);
|
||||||
|
|||||||
Reference in New Issue
Block a user