當前位置: 首頁>>代碼示例>>C++>>正文


C++ AddressTableEntry函數代碼示例

本文整理匯總了C++中AddressTableEntry函數的典型用法代碼示例。如果您正苦於以下問題:C++ AddressTableEntry函數的具體用法?C++ AddressTableEntry怎麽用?C++ AddressTableEntry使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了AddressTableEntry函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: refreshAddressTable

    void refreshAddressTable()
    {
        cachedAddressTable.clear();
        {
            LOCK(wallet->cs_wallet);
            BOOST_FOREACH(const PAIRTYPE(CTxDestination, std::string)& item, wallet->mapAddressBook)
            {
                const CRoscoinAddress& address = item.first;
                const std::string& strName = item.second;
                bool fMine = IsMine(*wallet, address.Get());
                cachedAddressTable.append(AddressTableEntry(fMine ? AddressTableEntry::Receiving : AddressTableEntry::Sending,
                                  QString::fromStdString(strName),
                                  QString::fromStdString(address.ToString())));
            }

            std::set<CStealthAddress>::iterator it;
            for (it = wallet->stealthAddresses.begin(); it != wallet->stealthAddresses.end(); ++it)
            {
                bool fMine = !(it->scan_secret.size() < 1);
                cachedAddressTable.append(AddressTableEntry(fMine ? AddressTableEntry::Receiving : AddressTableEntry::Sending,
                                  QString::fromStdString(it->label),
                                  QString::fromStdString(it->Encoded()),
                                  true));
            };
        }
        // qLowerBound() and qUpperBound() require our cachedAddressTable list to be sorted in asc order
        qSort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan());
    }
開發者ID:FrankenRockt,項目名稱:roscoin,代碼行數:28,代碼來源:addresstablemodel.cpp

示例2: refreshAddressTable

    void refreshAddressTable()
    {
        cachedAddressTable.clear();
        {
            LOCK(wallet->cs_wallet);
            BOOST_FOREACH(const PAIRTYPE(CTxDestination, std::string)& item, wallet->mapAddressBook)
            {
                const CBitcoinAddress& address = item.first;
                const std::string& strName = item.second;
                bool fMine = IsMine(*wallet, address.Get());

                if (fMine) {
                    std::string addr;
                    if (wallet->HasScrapeAddress(address.ToString()))
                        wallet->ReadScrapeAddress(address.ToString(), addr);

                    cachedAddressTable.append(AddressTableEntry(AddressTableEntry::Receiving,
                                      QString::fromStdString(strName),
                                      QString::fromStdString(address.ToString()),
                                      QString::fromStdString(addr)));
                } else {
                    cachedAddressTable.append(AddressTableEntry(AddressTableEntry::Sending,
                                      QString::fromStdString(strName),
                                      QString::fromStdString(address.ToString())));
                }
            }
        }
    }
開發者ID:cryptonit,項目名稱:Diamond,代碼行數:28,代碼來源:addresstablemodel.cpp

示例3: refreshAddressTable

    void refreshAddressTable()
    {
        cachedAddressTable.clear();
        {
            LOCK(wallet->cs_wallet);
            BOOST_FOREACH(const PAIRTYPE(CTxDestination, CAddressBookData)& item, wallet->mapAddressBook)
            {
                const CBitcoinAddress& address = item.first;
                bool fMine = IsMine(*wallet, address.Get());
                AddressTableEntry::Type addressType = translateTransactionType(
                        QString::fromStdString(item.second.purpose), fMine);
                const std::string& strName = item.second.name;
                cachedAddressTable.append(AddressTableEntry(addressType,
                                  QString::fromStdString(strName),
                                  QString::fromStdString(address.ToString())));
            }

            std::set<CStealthAddress>::iterator it;
            for (it = wallet->stealthAddresses.begin(); it != wallet->stealthAddresses.end(); ++it)
            {
                bool fMine = !(it->scan_secret.size() < 1);
                cachedAddressTable.append(AddressTableEntry(fMine ? AddressTableEntry::Receiving : AddressTableEntry::Sending,
                                  QString::fromStdString(it->label),
                                  QString::fromStdString(it->Encoded()),
                                  true));
            };
        }
        // qLowerBound() and qUpperBound() require our cachedAddressTable list to be sorted in asc order
        // Even though the map is already sorted this re-sorting step is needed because the originating map
        // is sorted by binary address, not by base58() address.
        qSort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan());
    }
開發者ID:DGCDev,項目名稱:digitalcoin,代碼行數:32,代碼來源:addresstablemodel.cpp

示例4: refreshAddressTable

    void refreshAddressTable()
    {
        std::vector<TxInfoRecord> vecRecord;
        
        {
            TRY_LOCK(cs_main, lockMain);
            
            if (lockMain)
            {
                vecRecord = ptxinfoStore->RecordsWithKey(TxInfoKey(INFO_ID, "n"));
            }
        }
        
        if (!vecRecord.empty())
        {
            cachedAddressTable.clear();
        }
        else
        {
            QMutableListIterator<AddressTableEntry> iter(cachedAddressTable);
            while (iter.hasNext())
            {
                if (iter.next().type != AddressTableEntry::Directory)
                {
                    iter.remove();
                }
            }
        }
        
        {
            LOCK(wallet->cs_wallet);
            
            BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, std::string)& item, wallet->mapAddressBook)
            {
                const CBitcoinAddress& address = item.first;
                const std::string& strName = item.second;
                bool fMine = wallet->HaveKey(address);
                cachedAddressTable.append(AddressTableEntry(fMine ? AddressTableEntry::Receiving : AddressTableEntry::Sending,
                                  QString::fromStdString(strName),
                                  QString::fromStdString(address.ToString())));
            }

            BOOST_FOREACH(const TxInfoRecord &record, vecRecord)
            {
                if (wallet->mapAddressBook.count(record.addr) > 0)
                {
                    continue;
                }
                
                cachedAddressTable.append(AddressTableEntry(AddressTableEntry::Directory, "",
                                                            QString::fromStdString(record.addr.ToString())));
            }
        }
    }
開發者ID:stamhe,項目名稱:shinycoin,代碼行數:54,代碼來源:addresstablemodel.cpp

示例5: refreshAddressTable

    void refreshAddressTable()
    {
        cachedAddressTable.clear();
        {
            LOCK(wallet->cs_wallet);
            BOOST_FOREACH(const PAIRTYPE(CTxDestination, CAddressBookData)& item, wallet->mapAddressBook)
            {
                const CMnemonicAddress& address = item.first;
                bool fMine = IsMine(*wallet, address.Get());
                AddressTableEntry::Type addressType = translateTransactionType(
                        QString::fromStdString(item.second.purpose), fMine);
                const std::string& strName = item.second.name;

			CMnemonicAddress bitcoinAddress;

			bitcoinAddress.SetString( address.ToString() );
			CKeyID keyID;
			bitcoinAddress.GetKeyID(keyID);

				//common::CPeriodicActionExecutor< client::DimsResponse >::getInstance()->addAction( new client::CSendBalanceInfoAction( address.ToString() ), 6000 );

                cachedAddressTable.append(AddressTableEntry(addressType,
                                  QString::fromStdString(strName),
                                  QString::fromStdString(address.ToString()),
								  CDimsUnits::format(0, wallet->AvailableCoinsAmount(keyID)) ));
            }
        }
        // qLowerBound() and qUpperBound() require our cachedAddressTable list to be sorted in asc order
        // Even though the map is already sorted this re-sorting step is needed because the originating map
        // is sorted by binary address, not by base58() address.
        qSort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan());
    }
開發者ID:salivan-ratcoin-dev-team,項目名稱:dims,代碼行數:32,代碼來源:addresstablemodel.cpp

示例6: refreshAddressTable

    void refreshAddressTable()
    {
        cachedAddressTable.clear();
        {
            LOCK(wallet->cs_wallet);
            BOOST_FOREACH(const PAIRTYPE(CTxDestination, std::string)& item, wallet->mapAddressBook)
            {
                const CBitcoinAddress& address = item.first;
                const std::string& strName = item.second;
                bool fMine = IsMine(*wallet, address.Get());
                bool fMyShare = IsMyShare(*wallet, address.Get());
                AddressTableEntry::Type type = fMine ? AddressTableEntry::Receiving : AddressTableEntry::Sending;
                AddressTableEntry::Category cate = AddressTableEntry::Normal;
                if ( fMyShare )
                {
                    cate = AddressTableEntry::MultiSig;
                    type = AddressTableEntry::Sending;
                }

                cachedAddressTable.append(AddressTableEntry(type,
                                  QString::fromStdString(strName),
                                  QString::fromStdString(address.ToString()), cate));
            }
        }
        // qLowerBound() and qUpperBound() require our cachedAddressTable list to be sorted in asc order
        qSort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan());
    }
開發者ID:60E,項目名稱:naocanfen,代碼行數:27,代碼來源:addresstablemodel.cpp

示例7: updateEntry

    void updateEntry(const QString &address, const QString &label, bool isMine, int status)
    {
        // Find address / label in model
        QList<AddressTableEntry>::iterator lower = qLowerBound(
            cachedAddressTable.begin(), cachedAddressTable.end(), address, AddressTableEntryLessThan());
        QList<AddressTableEntry>::iterator upper = qUpperBound(
            cachedAddressTable.begin(), cachedAddressTable.end(), address, AddressTableEntryLessThan());
        int lowerIndex = (lower - cachedAddressTable.begin());
        int upperIndex = (upper - cachedAddressTable.begin());
        bool inModel = (lower != upper);
        AddressTableEntry::Type newEntryType = isMine ? AddressTableEntry::Receiving : AddressTableEntry::Sending;

        switch(status)
        {
        case CT_NEW:
        {
            if(inModel)
            {
                OutputDebugStringF("Warning: AddressTablePriv::updateEntry: Got CT_NEW, but entry is already in model\n");
                break;
            }
            parent->beginInsertRows(QModelIndex(), lowerIndex, lowerIndex);

            std::string pmkey = "";
            std::string a;
            a = address.toStdString();
            int i;
            if (isMine)
            {
                i = SecureMsgGetLocalPublicKey(a, pmkey);
                if (i)
                    printf("Can't get PM Key for some reason\n");
            }

            cachedAddressTable.insert(lowerIndex, AddressTableEntry(newEntryType, label, address, QString::fromStdString(pmkey)));
            parent->endInsertRows();
            break;
        }
        case CT_UPDATED:
            if(!inModel)
            {
                OutputDebugStringF("Warning: AddressTablePriv::updateEntry: Got CT_UPDATED, but entry is not in model\n");
                break;
            }
            lower->type = newEntryType;
            lower->label = label;
            parent->emitDataChanged(lowerIndex);
            break;
        case CT_DELETED:
            if(!inModel)
            {
                OutputDebugStringF("Warning: AddressTablePriv::updateEntry: Got CT_DELETED, but entry is not in model\n");
                break;
            }
            parent->beginRemoveRows(QModelIndex(), lowerIndex, upperIndex-1);
            cachedAddressTable.erase(lower, upper);
            parent->endRemoveRows();
            break;
        }
    }
開發者ID:ChemCoin,項目名稱:Chemcoin,代碼行數:60,代碼來源:addresstablemodel.cpp

示例8: refreshAddressTable

    void refreshAddressTable()
    {
        cachedAddressTable.clear();
        {
            LOCK(wallet->cs_wallet);
            BOOST_FOREACH(const PAIRTYPE(CTxDestination, CAddressBookData)& item, wallet->mapAddressBook)
            {
                const CBitcoinAddress& address = item.first;

                AddressTableEntry::Type addressType;
                const std::string& strPurpose = item.second.purpose;
                if (strPurpose == "send") addressType = AddressTableEntry::Sending;
                else if (strPurpose == "receive") addressType = AddressTableEntry::Receiving;
                else if (strPurpose == "unknown") {
                    bool fMine = IsMine(*wallet, address.Get());
                    addressType = (fMine ? AddressTableEntry::Receiving : AddressTableEntry::Sending);
                }
                else continue; // "refund" addresses aren't shown, and change addresses aren't in mapAddressBook at all.

                const std::string& strName = item.second.name;
                cachedAddressTable.append(AddressTableEntry(addressType,
                                  QString::fromStdString(strName),
                                  QString::fromStdString(address.ToString())));
            }
        }
        // qLowerBound() and qUpperBound() require our cachedAddressTable list to be sorted in asc order
        // Even though the map is already sorted this re-sorting step is needed because the originating map
        // is sorted by binary address, not by base58() address.
        qSort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan());
    }
開發者ID:craftcoin,項目名稱:bitcoin,代碼行數:30,代碼來源:addresstablemodel.cpp

示例9: refreshAddressTable

    void refreshAddressTable()
    {
        cachedAddressTable.clear();
        {
            LOCK(wallet->cs_wallet);
            BOOST_FOREACH(const PAIRTYPE(CTxDestination, std::string)& item, wallet->mapAddressBook)
            {
                const CBitcoinAddress& address = item.first;
                const std::string& strName = item.second;
                bool fMine = IsMine(*wallet, address.Get());

                std::string a;
                std::string PMKey = "";
                a = address.ToString();

                if (fMine)
                {
                    int i = SecureMsgGetLocalPublicKey(a, PMKey);
                    if (i == 4)
                        PMKey = "Wallet is Locked.";
                    else if (i)
                        printf("Error getting PM Key %i\n", i);
                }

                cachedAddressTable.append(AddressTableEntry(fMine ? AddressTableEntry::Receiving : AddressTableEntry::Sending,
                                  QString::fromStdString(strName),
                                  QString::fromStdString(address.ToString()),
                                  QString::fromStdString(PMKey)));
            }

            std::set<CStealthAddress>::iterator it;
            for (it = wallet->stealthAddresses.begin(); it != wallet->stealthAddresses.end(); ++it)
            {
                bool fMine = !(it->scan_secret.size() < 1);
                cachedAddressTable.append(AddressTableEntry(fMine ? AddressTableEntry::Receiving : AddressTableEntry::Sending,
                                  QString::fromStdString(it->label),
                                  QString::fromStdString(it->Encoded()),
                                  QString::fromStdString(""),
                                  true));
            };
        }
        // qLowerBound() and qUpperBound() require our cachedAddressTable list to be sorted in asc order
        qSort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan());
    }
開發者ID:ChemCoin,項目名稱:Chemcoin,代碼行數:44,代碼來源:addresstablemodel.cpp

示例10: updateEntry

    void updateEntry(const QString &address, const QString &label, bool isMine, int status)
    {
        // Find address / label in model
        QList<AddressTableEntry>::iterator lower = qLowerBound(
            cachedAddressTable.begin(), cachedAddressTable.end(), address, AddressTableEntryLessThan());
        QList<AddressTableEntry>::iterator upper = qUpperBound(
            cachedAddressTable.begin(), cachedAddressTable.end(), address, AddressTableEntryLessThan());
        int lowerIndex = (lower - cachedAddressTable.begin());
        int upperIndex = (upper - cachedAddressTable.begin());
        bool inModel = (lower != upper);
        AddressTableEntry::Type newEntryType = isMine ? AddressTableEntry::Receiving : AddressTableEntry::Sending;

        switch(status)
        {
        case CT_NEW:
            if(inModel)
            {
                OutputDebugStringF("Warning: AddressTablePriv::updateEntry: Got CT_NOW, but entry is already in model\n");
                break;
            }
            {
                CBitcoinAddress addr(address.toStdString());
                AddressTableEntry::Category cate = IsMyShare(*wallet, addr.Get()) ? AddressTableEntry::MultiSig : AddressTableEntry::Normal;

                parent->beginInsertRows(QModelIndex(), lowerIndex, lowerIndex);
                cachedAddressTable.insert(lowerIndex, AddressTableEntry(newEntryType, label, address, cate));
                parent->endInsertRows();
            }
            break;
        case CT_UPDATED:
            if(!inModel)
            {
                OutputDebugStringF("Warning: AddressTablePriv::updateEntry: Got CT_UPDATED, but entry is not in model\n");
                break;
            }
            lower->type = newEntryType;
            lower->label = label;
            parent->emitDataChanged(lowerIndex);
            break;
        case CT_DELETED:
            if(!inModel)
            {
                OutputDebugStringF("Warning: AddressTablePriv::updateEntry: Got CT_DELETED, but entry is not in model\n");
                break;
            }
            parent->beginRemoveRows(QModelIndex(), lowerIndex, upperIndex-1);
            cachedAddressTable.erase(lower, upper);
            parent->endRemoveRows();
            break;
        }
    }
開發者ID:60E,項目名稱:naocanfen,代碼行數:51,代碼來源:addresstablemodel.cpp

示例11: refreshAddressTable

 void refreshAddressTable()
 {
     cachedAddressTable.clear();
     {
         LOCK(wallet->cs_wallet);
         BOOST_FOREACH(const PAIRTYPE(CTxDestination, std::string)& item, wallet->mapAddressBook)
         {
             const CNaanayamAddress& address = item.first;
             const std::string& strName = item.second;
             bool fMine = IsMine(*wallet, address.Get());
             cachedAddressTable.append(AddressTableEntry(fMine ? AddressTableEntry::Receiving : AddressTableEntry::Sending,
                               QString::fromStdString(strName),
                               QString::fromStdString(address.ToString())));
         }
     }
 }
開發者ID:NaanaYaM,項目名稱:naanayam,代碼行數:16,代碼來源:addresstablemodel.cpp

示例12: updateEntry

    void updateEntry(const QString &address, const QString &label, bool isMine, const QString &purpose, int status)
    {
        // Find address / label in model
        QList<AddressTableEntry>::iterator lower = qLowerBound(
            cachedAddressTable.begin(), cachedAddressTable.end(), address, AddressTableEntryLessThan());
        QList<AddressTableEntry>::iterator upper = qUpperBound(
            cachedAddressTable.begin(), cachedAddressTable.end(), address, AddressTableEntryLessThan());
        int lowerIndex = (lower - cachedAddressTable.begin());
        int upperIndex = (upper - cachedAddressTable.begin());
        bool inModel = (lower != upper);
        AddressTableEntry::Type newEntryType = translateTransactionType(purpose, isMine);

        switch(status)
        {
        case CT_NEW:
            if(inModel)
            {
                qWarning() << "AddressTablePriv::updateEntry : Warning: Got CT_NEW, but entry is already in model";
                break;
            }
            parent->beginInsertRows(QModelIndex(), lowerIndex, lowerIndex);
            cachedAddressTable.insert(lowerIndex, AddressTableEntry(newEntryType, label, address));
            parent->endInsertRows();
            break;
        case CT_UPDATED:
            if(!inModel)
            {
                qWarning() << "AddressTablePriv::updateEntry : Warning: Got CT_UPDATED, but entry is not in model";
                break;
            }
            lower->type = newEntryType;
            lower->label = label;
            parent->emitDataChanged(lowerIndex);
            break;
        case CT_DELETED:
            if(!inModel)
            {
                qWarning() << "AddressTablePriv::updateEntry : Warning: Got CT_DELETED, but entry is not in model";
                break;
            }
            parent->beginRemoveRows(QModelIndex(), lowerIndex, upperIndex-1);
            cachedAddressTable.erase(lower, upper);
            parent->endRemoveRows();
            break;
        }
    }
開發者ID:deuscoin,項目名稱:deuscoin,代碼行數:46,代碼來源:addresstablemodel.cpp

示例13: refreshAddressTable

    void refreshAddressTable()
    {
        cachedAddressTable.clear();

        {
            LOCK(wallet->cs_wallet);
            BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, std::string)& item, wallet->mapAddressBook)
            {
                const CBitcoinAddress& address = item.first;
                const std::string& strName = item.second;
                bool fMine = wallet->HaveKey(address);
                cachedAddressTable.append(AddressTableEntry(fMine ? AddressTableEntry::Receiving : AddressTableEntry::Sending,
                                  QString::fromStdString(strName),
                                  QString::fromStdString(address.ToString())));
            }
        }
    }
開發者ID:TGCproject,項目名稱:ThirdGenerationCoin,代碼行數:17,代碼來源:addresstablemodel.cpp

示例14: refreshAddressTable

 void refreshAddressTable()
 {
     cachedAddressTable.clear();
     {
         LOCK(wallet->cs_wallet);
         BOOST_FOREACH(const PAIRTYPE(CTxDestination, std::string)& item, wallet->mapAddressBook)
         {
             const CTalkcoinAddress& address = item.first;
             const std::string& strName = item.second;
             bool fMine = IsMine(*wallet, address.Get());
             cachedAddressTable.append(AddressTableEntry(fMine ? AddressTableEntry::Receiving : AddressTableEntry::Sending,
                               QString::fromStdString(strName),
                               QString::fromStdString(address.ToString())));
         }
     }
     // qLowerBound() and qUpperBound() require our cachedAddressTable list to be sorted in asc order
     qSort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan());
 }
開發者ID:Esthiem,項目名稱:talkcoin-wallet,代碼行數:18,代碼來源:addresstablemodel.cpp

示例15: refreshAddressTable

 void refreshAddressTable(interfaces::Wallet& wallet)
 {
     cachedAddressTable.clear();
     {
         for (const auto& address : wallet.getAddresses())
         {
             AddressTableEntry::Type addressType = translateTransactionType(
                     QString::fromStdString(address.purpose), address.is_mine);
             cachedAddressTable.append(AddressTableEntry(addressType,
                               QString::fromStdString(address.name),
                               QString::fromStdString(EncodeDestination(address.dest))));
         }
     }
     // qLowerBound() and qUpperBound() require our cachedAddressTable list to be sorted in asc order
     // Even though the map is already sorted this re-sorting step is needed because the originating map
     // is sorted by binary address, not by base58() address.
     qSort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan());
 }
開發者ID:994920256,項目名稱:bitcoin,代碼行數:18,代碼來源:addresstablemodel.cpp


注:本文中的AddressTableEntry函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。