src/wallet/rpcwallet.cpp
UniValue listunspentmintzerocoins(const UniValue &params, bool fHelp) {
    if (fHelp || params.size() > 2)
        throw runtime_error(
                "listunspentmintzerocoins [minconf=1] [maxconf=9999999] \n"
                        "Returns array of unspent transaction outputs\n"
                        "with between minconf and maxconf (inclusive) confirmations.\n"
                        "Results are an array of Objects, each of which has:\n"
                        "{txid, vout, scriptPubKey, amount, confirmations}");

    if (pwalletMain->IsLocked())
        throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED,
                           "Error: Please enter the wallet passphrase with walletpassphrase first.");

    RPCTypeCheck(params, boost::assign::list_of(UniValue::VNUM)(UniValue::VNUM)(UniValue::VARR));

    int nMinDepth = 1;
    if (params.size() > 0)
        nMinDepth = params[0].get_int();

    int nMaxDepth = 9999999;
    if (params.size() > 1)
        nMaxDepth = params[1].get_int();

    UniValue results(UniValue::VARR);
    vector <COutput> vecOutputs;
    assert(pwalletMain != NULL);
    pwalletMain->ListAvailableCoinsMintCoins(vecOutputs, false);
    LogPrintf("vecOutputs.size()=%s\n", vecOutputs.size());
    BOOST_FOREACH(const COutput &out, vecOutputs)
    {
        if (out.nDepth < nMinDepth || out.nDepth > nMaxDepth)
            continue;

        int64_t nValue = out.tx->vout[out.i].nValue;
        const CScript &pk = out.tx->vout[out.i].scriptPubKey;
        UniValue entry(UniValue::VOBJ);
        entry.push_back(Pair("txid", out.tx->GetHash().GetHex()));
        entry.push_back(Pair("vout", out.i));
        entry.push_back(Pair("scriptPubKey", HexStr(pk.begin(), pk.end())));
        if (pk.IsPayToScriptHash()) {
            CTxDestination address;
            if (ExtractDestination(pk, address)) {
                const CScriptID &hash = boost::get<CScriptID>(address);
                CScript redeemScript;
                if (pwalletMain->GetCScript(hash, redeemScript))
                    entry.push_back(Pair("redeemScript", HexStr(redeemScript.begin(), redeemScript.end())));
            }
        }
        entry.push_back(Pair("amount", ValueFromAmount(nValue)));
        entry.push_back(Pair("confirmations", out.nDepth));
        results.push_back(entry);
    }

    return results;
}
//[vtlcoin]: verticalcoin section
// verticalcoin section
[vtlcoin]: verticalcoin section
verticalcoin section
[ vtlcoin ] : verticalcoin section verticalcoin section
UniValue listunspentmintzerocoins(const UniValue &params, bool fHelp) {
    if (fHelp || params.size() > 2)
        throw runtime_error(
                "listunspentmintzerocoins [minconf=1] [maxconf=9999999] \n"
                        "Returns array of unspent transaction outputs\n"
                        "with between minconf and maxconf (inclusive) confirmations.\n"
                        "Results are an array of Objects, each of which has:\n"
                        "{txid, vout, scriptPubKey, amount, confirmations}");
    if (pwalletMain->IsLocked())
        throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED,
                           "Error: Please enter the wallet passphrase with walletpassphrase first.");
    RPCTypeCheck(params, boost::assign::list_of(UniValue::VNUM)(UniValue::VNUM)(UniValue::VARR));
    int nMinDepth = 1;
    if (params.size() > 0)
        nMinDepth = params[0].get_int();
    int nMaxDepth = 9999999;
    if (params.size() > 1)
        nMaxDepth = params[1].get_int();
    UniValue results(UniValue::VARR);
    vector <COutput> vecOutputs;
    assert(pwalletMain != NULL);
    pwalletMain->ListAvailableCoinsMintCoins(vecOutputs, false);
    LogPrintf("vecOutputs.size()=%s\n", vecOutputs.size());
    BOOST_FOREACH(const COutput &out, vecOutputs)
    {
        if (out.nDepth < nMinDepth || out.nDepth > nMaxDepth)
            continue;
        int64_t nValue = out.tx->vout[out.i].nValue;
        const CScript &pk = out.tx->vout[out.i].scriptPubKey;
        UniValue entry(UniValue::VOBJ);
        entry.push_back(Pair("txid", out.tx->GetHash().GetHex()));
        entry.push_back(Pair("vout", out.i));
        entry.push_back(Pair("scriptPubKey", HexStr(pk.begin(), pk.end())));
        if (pk.IsPayToScriptHash()) {
            CTxDestination address;
            if (ExtractDestination(pk, address)) {
                const CScriptID &hash = boost::get<CScriptID>(address);
                CScript redeemScript;
                if (pwalletMain->GetCScript(hash, redeemScript))
                    entry.push_back(Pair("redeemScript", HexStr(redeemScript.begin(), redeemScript.end())));
            }
        }
        entry.push_back(Pair("amount", ValueFromAmount(nValue)));
        entry.push_back(Pair("confirmations", out.nDepth));
        results.push_back(entry);
    }
    return results;
}
UniValue listunspentmintzerocoins ( const UniValue & params , bool fHelp ) { if ( fHelp || params . size ( ) > 2 ) throw runtime_error ( " \n " " \n " " \n " " \n " " " ) ; if ( pwalletMain -> IsLocked ( ) ) throw JSONRPCError ( RPC_WALLET_UNLOCK_NEEDED , " " ) ; RPCTypeCheck ( params , boost :: assign :: list_of ( UniValue :: VNUM ) ( UniValue :: VNUM ) ( UniValue :: VARR ) ) ; int nMinDepth = 1 ; if ( params . size ( ) > 0 ) nMinDepth = params [ 0 ] . get_int ( ) ; int nMaxDepth = 9999999 ; if ( params . size ( ) > 1 ) nMaxDepth = params [ 1 ] . get_int ( ) ; UniValue results ( UniValue :: VARR ) ; vector < COutput > vecOutputs ; assert ( pwalletMain != NULL ) ; pwalletMain -> ListAvailableCoinsMintCoins ( vecOutputs , false ) ; LogPrintf ( " \n " , vecOutputs . size ( ) ) ; BOOST_FOREACH ( const COutput & out , vecOutputs ) { if ( out . nDepth < nMinDepth || out . nDepth > nMaxDepth ) continue ; int64_t nValue = out . tx -> vout [ out . i ] . nValue ; const CScript & pk = out . tx -> vout [ out . i ] . scriptPubKey ; UniValue entry ( UniValue :: VOBJ ) ; entry . push_back ( Pair ( " " , out . tx -> GetHash ( ) . GetHex ( ) ) ) ; entry . push_back ( Pair ( " " , out . i ) ) ; entry . push_back ( Pair ( " " , HexStr ( pk . begin ( ) , pk . end ( ) ) ) ) ; if ( pk . IsPayToScriptHash ( ) ) { CTxDestination address ; if ( ExtractDestination ( pk , address ) ) { const CScriptID & hash = boost :: get < CScriptID > ( address ) ; CScript redeemScript ; if ( pwalletMain -> GetCScript ( hash , redeemScript ) ) entry . push_back ( Pair ( " " , HexStr ( redeemScript . begin ( ) , redeemScript . end ( ) ) ) ) ; } } entry . push_back ( Pair ( " " , ValueFromAmount ( nValue ) ) ) ; entry . push_back ( Pair ( " " , out . nDepth ) ) ; results . push_back ( entry ) ; } return results ; }
[vtlcoin]: verticalcoin section
verticalcoin section
[ vtlcoin ] : verticalcoin section verticalcoin section