Sweep on daemon properly up to tip

This commit is contained in:
DataHoarder 2023-04-15 13:45:31 +02:00
parent 1a8812ff43
commit c2e527e96b
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk

View file

@ -203,7 +203,8 @@ func main() {
//process older full blocks and sweeps
for range time.NewTicker(time.Second * monero.BlockTime).C {
mainTip := indexDb.GetMainBlockTip()
actualTip := indexDb.GetMainBlockTip()
mainTip := actualTip
maxDepth := mainTip.Height - randomx.SeedHashEpochBlocks*4
//find top start height
@ -218,10 +219,10 @@ func main() {
}
if mainTip.Height == maxDepth {
log.Printf("Use scansweeps to backfill data")
log.Printf("Reached maxdepth %d: Use scansweeps to backfill data", maxDepth)
}
for h := mainTip.Height - monero.MinerRewardUnlockTime; h <= mainTip.Height-monero.TransactionUnlockTime; h++ {
for h := mainTip.Height - monero.MinerRewardUnlockTime; h <= actualTip.Height-monero.TransactionUnlockTime; h++ {
b := indexDb.GetMainBlockByHeight(h)
if b == nil {
continue