permissions: changes to check for node syncing before starting permissions

This commit is contained in:
vsmk98 2019-05-03 15:31:26 +08:00
parent 385a2334d8
commit 2716937f2e
2 changed files with 3 additions and 0 deletions

View File

@ -352,6 +352,7 @@ func (d *Downloader) synchronise(id string, hash common.Hash, td *big.Int, mode
if !atomic.CompareAndSwapInt32(&d.synchronising, 0, 1) {
return errBusy
}
// changes for permissions. added set sync status to indicate permisssions that node sync has started
types.SetSyncStatus()
defer atomic.StoreInt32(&d.synchronising, 0)

View File

@ -277,6 +277,8 @@ func (pm *ProtocolManager) applyRaftSnapshot(raftSnapshot raftpb.Snapshot) {
log.Info(chainExtensionMessage, "hash", pm.blockchain.CurrentBlock().Hash())
} else {
// added for permissions changes to indicate node sync up has started
types.SetSyncStatus()
log.Info("blockchain is caught up; no need to synchronize")
}