Post
Topic
Board Announcements (Altcoins)
Re: [ANN]|Chatcoin|NIST5|Chat in Wallet|No premine|P2P Private Chat|No vote
by
ChatcoinTeam
on 19/08/2014, 05:43:08 UTC
Code:
Value vote2(const Array& params, bool fHelp)
{
    if (fHelp || params.size() != 1)
        throw runtime_error(
            "votedev \n"
            "Percentage to be given to developers 0-10");

    if (nSubsidy <= 0)
        throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Invalid Subsidy");

    if (!(params[0].get_real() >= 0 && params[0].get_real() <= 10))
        throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid Percentage");

    int64 nVote2 = nSubsidy * params[0].get_real() / 100;

    CChatcoinAddress address(GetVote2Addr());
    if (!address.IsValid())
        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Chatcoin address");

    // Amount
    int64 nAmount = GetVote2Value();

    // Wallet comments
    CWalletTx wtx;
    wtx.mapValue["to"] = GetVote2Lbl();

    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, wtx, false, nVote2);
    if (strError != "")
        throw JSONRPCError(RPC_WALLET_ERROR, strError);

    return wtx.GetHash().GetHex();
}

what's this?
This is the code for voting the charity
but this function has been closed in chatcoin. charity is set to 2% for chatcoin
 and most coin has been spent for giveaway