Add batontxid to transfer

This commit is contained in:
jl777
2019-01-14 23:09:04 -11:00
parent 52c163fe45
commit 3c03185b00

View File

@@ -5601,11 +5601,11 @@ UniValue marmara_issue(const UniValue& params, bool fHelp)
UniValue marmara_transfer(const UniValue& params, bool fHelp) UniValue marmara_transfer(const UniValue& params, bool fHelp)
{ {
UniValue result(UniValue::VOBJ); uint256 createtxid,batontxid; std::vector<uint8_t> receiverpub; int64_t amount; int32_t matures; std::string currency; UniValue result(UniValue::VOBJ); uint256 batontxid; std::vector<uint8_t> receiverpub; int64_t amount; int32_t matures; std::string currency;
if ( fHelp || params.size() != 5 ) if ( fHelp || params.size() != 6 )
{ {
// marmaratransfer 028076d42eb20efc10007fafb5ca66a2052523c0d2221e607adf958d1a332159f6 7.5 MARMARA 3903 bf6b4d42aa3ce974c853d73b06c78597dd3b5fb493d5d0d944f72c2017f561ad // marmaratransfer 028076d42eb20efc10007fafb5ca66a2052523c0d2221e607adf958d1a332159f6 7.5 MARMARA 3903 748a4c80e6f6b725340fb0f52738f38a11c422d59b3034c8366b3d7b33c99a1e
throw runtime_error("marmaratransfer receiverpk amount currency matures batontxid\n"); throw runtime_error("marmaratransfer receiverpk amount currency matures approvaltxid\n");
} }
if ( ensure_CCrequirements() < 0 ) if ( ensure_CCrequirements() < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n"); throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
@@ -5618,10 +5618,9 @@ UniValue marmara_transfer(const UniValue& params, bool fHelp)
amount = atof(params[1].get_str().c_str()) * COIN + 0.00000000499999; amount = atof(params[1].get_str().c_str()) * COIN + 0.00000000499999;
currency = params[2].get_str(); currency = params[2].get_str();
matures = atol(params[3].get_str().c_str()); matures = atol(params[3].get_str().c_str());
batontxid = Parseuint256((char *)params[4].get_str().c_str()); approvaltxid = Parseuint256((char *)params[4].get_str().c_str());
if ( MarmaraGetcreatetxid(createtxid,batontxid) < 0 ) batontxid = Parseuint256((char *)params[5].get_str().c_str());
throw runtime_error("invalid batontxid"); return(MarmaraIssue(0,'T',pubkey2pk(receiverpub),amount,currency,matures,approvaltxid,batontxid));
return(MarmaraIssue(0,'T',pubkey2pk(receiverpub),amount,currency,matures,createtxid,batontxid));
} }
UniValue marmara_info(const UniValue& params, bool fHelp) UniValue marmara_info(const UniValue& params, bool fHelp)