mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-03-09 19:34:29 +00:00
core: swap transfer and MPT GC
It doesn't change anything logically, but transfer GC needs to have current block timestamp for its logic and if we're delaying it with MPT GC it can more often fail to obtain it: 2025-01-13T16:15:18.311+0300 ERROR failed to get block timestamp transfer GC {"time": "1.022µs", "index": 20000} It's not critical, this garbage can still be collected on the next run, but we better avoid this anyway. Refs. #3783. Signed-off-by: Roman Khimov <roman@nspcc.ru>
This commit is contained in:
parent
4d2b88dd9d
commit
1f83f472c7
1 changed files with 2 additions and 2 deletions
|
@ -1159,8 +1159,8 @@ func (bc *Blockchain) tryRunGC(oldHeight uint32) time.Duration {
|
|||
oldHeight /= bc.config.Ledger.GarbageCollectionPeriod
|
||||
newHeight /= bc.config.Ledger.GarbageCollectionPeriod
|
||||
if tgtBlock > int64(bc.config.Ledger.GarbageCollectionPeriod) && newHeight != oldHeight {
|
||||
dur = bc.stateRoot.GC(uint32(tgtBlock), bc.store)
|
||||
dur += bc.removeOldTransfers(uint32(tgtBlock))
|
||||
dur = bc.removeOldTransfers(uint32(tgtBlock))
|
||||
dur += bc.stateRoot.GC(uint32(tgtBlock), bc.store)
|
||||
}
|
||||
return dur
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue