Add error for sending coin to source chain

This commit is contained in:
blackjok3r
2018-09-26 17:25:02 +08:00
parent ff9e1c7f36
commit 396d4e4209

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 (strcmp(ASSETCHAINS_SYMBOL,targetSymbol.c_str()) == 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");