try to add error check if export/import chain is the same

This commit is contained in:
blackjok3r
2018-09-26 15:03:55 +08:00
parent 4dfc49c00e
commit 79171fa13b

View File

@@ -169,6 +169,9 @@ UniValue migrate_converttoexport(const UniValue& params, bool fHelp)
if (targetSymbol.size() == 0 || targetSymbol.size() > 32) if (targetSymbol.size() == 0 || targetSymbol.size() > 32)
throw runtime_error("targetSymbol length must be >0 and <=32"); throw runtime_error("targetSymbol length must be >0 and <=32");
if (strncmp(ASSETCHAINS_SYMBOL,targetSymbol) == 0)
throw runtime_error("cant send a coin to the same chain");
CAmount burnAmount = AmountFromValue(params[2]); CAmount burnAmount = AmountFromValue(params[2]);
if (burnAmount <= 0) if (burnAmount <= 0)
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount for export"); throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount for export");