[#132] Flag all gracefully shutdown nodes in cleaner cache

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-10-29 19:04:17 +03:00 committed by Alex Vanin
parent 118f7fb309
commit 6fcaa13e0b

View file

@ -41,7 +41,7 @@ func (np *Processor) processAddPeer(node []byte) {
} }
} }
// Process new epoch tick by invoking new epoch method in network map contract. // Process update peer notification by sending approval tx to the smart contract.
func (np *Processor) processUpdatePeer(ev netmapEvent.UpdatePeer) { func (np *Processor) processUpdatePeer(ev netmapEvent.UpdatePeer) {
if !np.activeState.IsActive() { if !np.activeState.IsActive() {
np.log.Info("passive mode, ignore new epoch tick") np.log.Info("passive mode, ignore new epoch tick")
@ -57,6 +57,10 @@ func (np *Processor) processUpdatePeer(ev netmapEvent.UpdatePeer) {
return return
} }
// flag node to remove from local view, so it can be re-bootstrapped
// again before new epoch will tick
np.netmapSnapshot.flag(ev.PublicKey().String())
err := invoke.UpdatePeerState(np.morphClient, np.netmapContract, err := invoke.UpdatePeerState(np.morphClient, np.netmapContract,
&invoke.UpdatePeerArgs{ &invoke.UpdatePeerArgs{
Key: ev.PublicKey(), Key: ev.PublicKey(),