Пример #1
0
void WalletModel::pollBalanceChanged()
{
    if(nBestHeight != cachedNumBlocks)
    {
        // Balance and number of transactions might have changed
        cachedNumBlocks = nBestHeight;
        checkBalanceChanged();

        if (!IsInitialBlockDownload())
        {
            if (!fSyncedAtLeastOnce)
            {
                // On client start it fails to broadcast (too few connections?), so we wait for full synchronization
                QDateTime lastBlockDate = QDateTime::fromTime_t(pindexBest->GetBlockTime());
                QDateTime currentDate = QDateTime::currentDateTime();
                int secs = lastBlockDate.secsTo(currentDate);
                if (secs < 90*60 && nBestHeight >= GetNumBlocksOfPeers())
                    fSyncedAtLeastOnce = true;
            }

            if (fSyncedAtLeastOnce)
                sendPendingNameFirstUpdates();
        }
    }
}
Пример #2
0
int ClientModel::getNumBlocksOfPeers() const
{
    return GetNumBlocksOfPeers();
}