Example #1
0
void TransactionAcquire::onTimer (bool progress, ScopedLockType& psl)
{
    bool aggressive = false;

    if (getTimeouts () > 10)
    {
        WriteLog (lsWARNING, TransactionAcquire) << "Ten timeouts on TX set " << getHash ();
        psl.unlock();
        {
            Application::ScopedLockType lock (getApp().getMasterLock (), __FILE__, __LINE__);

            if (getApp().getOPs ().stillNeedTXSet (mHash))
            {
                WriteLog (lsWARNING, TransactionAcquire) << "Still need it";
                mTimeouts = 0;
                aggressive = true;
	    }
        }
        psl.lock(__FILE__, __LINE__);

        if (!aggressive)
        {
            mFailed = true;
            done ();
            return;
        }
    }

    if (aggressive || !getPeerCount ())
    {
        // out of peers
        WriteLog (lsWARNING, TransactionAcquire) << "Out of peers for TX set " << getHash ();

        bool found = false;
        std::vector<Peer::pointer> peerList = getApp().getPeers ().getPeerVector ();
        BOOST_FOREACH (Peer::ref peer, peerList)
        {
            if (peer->hasTxSet (getHash ()))
            {
                found = true;
                peerHas (peer);
            }
        }

        if (!found)
        {
            BOOST_FOREACH (Peer::ref peer, peerList)
            peerHas (peer);
        }
    }
Example #2
0
    void EtherIPC::onTimer() {
        getPeerCount();
        getSyncing();

        if ( !fBlockFilterID.isEmpty() && !fSyncing ) {
            getFilterChanges(fBlockFilterID);
        } else {
            getBlockNumber();
        }

        if ( !fEventFilterID.isEmpty() ) {
            getFilterChanges(fEventFilterID);
        }
    }
Example #3
0
 void EtherIPC::onTimer() {
     getPeerCount();
     getFilterChanges(fFilterID);
 }