Fix the ledger range we advertise to peers

This commit is contained in:
JoelKatz
2014-03-04 13:13:35 -08:00
committed by Vinnie Falco
parent 8b1df06a94
commit adc4c855ca

View File

@@ -424,11 +424,16 @@ public:
return true;
}
// Get the earliest ledger we will let peers fetch
uint32 getEarliestFetch ()
{
// The earliest ledger we will let people fetch is ledger zero,
// unless that creates a larger range than allowed
uint32 e = getClosedLedger()->getLedgerSeq();
if (e > getConfig().FETCH_DEPTH)
e -= getConfig().FETCH_DEPTH;
else
e = 0;
return e;
}