From 0161c77e078fcd3b89739039b987daa86b164193 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Sun, 30 Dec 2018 12:31:03 +0800 Subject: [PATCH] Fix createexport transaction. Leave params != to 3, for backwards compatability, third param is now ignored. --- src/rpc/crosschain.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/rpc/crosschain.cpp b/src/rpc/crosschain.cpp index 7d299fc1a..8853b3fb2 100644 --- a/src/rpc/crosschain.cpp +++ b/src/rpc/crosschain.cpp @@ -145,9 +145,9 @@ UniValue calc_MoM(const UniValue& params, bool fHelp) UniValue migrate_converttoexport(const UniValue& params, bool fHelp) { - if (fHelp || params.size() != 3) + if (fHelp || params.size() != 3 || params.size() != 2) throw runtime_error( - "migrate_converttoexport rawTx dest_symbol export_amount\n" + "migrate_converttoexport rawTx dest_symbol\n" "\nConvert a raw transaction to a cross-chain export.\n" "If neccesary, the transaction should be funded using fundrawtransaction.\n" "Finally, the transaction should be signed using signrawtransaction\n" @@ -174,17 +174,13 @@ UniValue migrate_converttoexport(const UniValue& params, bool fHelp) 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 = 0; + + for (int i=0; i 1000000LL*COIN) - throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount for export, cannot export more than 1 million coins per export."); - { - CAmount needed = 0; - for (int i=0; i