Post
Topic
Board Announcements (Altcoins)
Re: [ANN] Nightmare | NM | FRESH algo | NightSend | Encrypted P2P Chat | 8/15
by
nightmarecoin
on 17/08/2014, 19:17:12 UTC

Thank you. Yes credit will be given. We will submit a commit to your rpcwallet.cpp later today for the sendto fix to help you out. Here it is before we commit it -

Code:
Value sendtoaddress(const Array& params, bool fHelp)
{
    if (fHelp || params.size() < 2 || params.size() > 5)
        throw runtime_error(
            "sendtoaddress [comment] [comment-to]\n"
            " is a real and is rounded to the nearest 0.000001"
            + HelpRequiringPassphrase());
 
    CBitcoinAddress address(params[0].get_str());
    if (!address.IsValid())
        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Nightmare address");
 
    // Amount
    int64_t nAmount = AmountFromValue(params[1]);
 
    CWalletTx wtx;
    std::string sNarr;
/*
    if (params.size() > 2 && params[2].type() != null_type && !params[2].get_str().empty())
        sNarr = params[2].get_str();
 
    if (sNarr.length() > 24)
        throw runtime_error("Narration must be 24 characters or less.");
*/
    // Wallet comments
    if (params.size() > 2 && params[2].type() != null_type && !params[2].get_str().empty())
        wtx.mapValue["comment"] = params[2].get_str();
    if (params.size() > 3 && params[3].type() != null_type && !params[3].get_str().empty())
        wtx.mapValue["to"]      = params[3].get_str();
 
    sNarr = "";
    if (pwalletMain->IsLocked())
        throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Error: Please enter the wallet passphrase with walletpassphrase first.");
 
    string strError = pwalletMain->SendMoneyToDestination(address.Get(), nAmount, sNarr, wtx);
    if (strError != "")
        throw JSONRPCError(RPC_WALLET_ERROR, strError);
 
    return wtx.GetHash().GetHex();
}