Rework the way the results of ledger and TX map acquisition is passed up and down the

call chain so that the peer logic will know how helpful peers are being, not just whether
they're sending invalid data.
This commit is contained in:
JoelKatz
2012-11-21 09:28:09 -08:00
parent f98741af3c
commit 89d54999c9
11 changed files with 155 additions and 84 deletions

View File

@@ -213,12 +213,28 @@ void ProofOfWorkGenerator::sweep()
void ProofOfWorkGenerator::loadHigh()
{
// WRITEME
time_t now = time(NULL);
boost::mutex::scoped_lock sl(mLock);
if (mLastDifficultyChange == now)
return;
if (mPowEntry == 30)
return;
++mPowEntry;
mLastDifficultyChange = now;
}
void ProofOfWorkGenerator::loadLow()
{
// WRITEME
time_t now = time(NULL);
boost::mutex::scoped_lock sl(mLock);
if (mLastDifficultyChange == now)
return;
if (mPowEntry == 0)
return;
--mPowEntry;
mLastDifficultyChange = now;
}
struct PowEntry