mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Ledger acquire fixes/cleanups/logging
* Inbound ledger and SHAMapAddNode cleanup
* Log acquire stats
* Fix progress logic
* Remove ledgers we no longer need to acquire
* Stash stale state data in our fetch pack, it can still be useful
* Stash in fetch pack if acquire terminated while job was pending
* Account for duplicate/invalid nodes in a few cases previously missed
* Dispatch each InboundLedger once (not per data)
* Trigger only the "best" peer
* Don't call tryAdvance on failed acquires
This commit is contained in:
@@ -50,7 +50,7 @@ public:
|
||||
, mLastCloseConvergeTime (1000 * LEDGER_IDLE_INTERVAL)
|
||||
, mLastCloseTime (0)
|
||||
, mLastValidationTime (0)
|
||||
, mFetchPack ("FetchPack", 2048, 20)
|
||||
, mFetchPack ("FetchPack", 65536, 45)
|
||||
, mFetchSeq (0)
|
||||
, mLastLoadBase (256)
|
||||
, mLastLoadFactor (256)
|
||||
@@ -3066,6 +3066,11 @@ int NetworkOPsImp::getFetchSize ()
|
||||
|
||||
void NetworkOPsImp::gotFetchPack (bool progress, uint32 seq)
|
||||
{
|
||||
|
||||
// FIXME: Calling this function more than once will result in
|
||||
// InboundLedgers::gotFetchPack being called more than once
|
||||
// which is expensive. A flag should track whether we've already dispatched
|
||||
|
||||
getApp().getJobQueue ().addJob (jtLEDGER_DATA, "gotFetchPack",
|
||||
BIND_TYPE (&InboundLedgers::gotFetchPack, &getApp().getInboundLedgers (), P_1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user