[#132] Flag all gracefully shutdown nodes in cleaner cache
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
118f7fb309
commit
6fcaa13e0b
1 changed files with 5 additions and 1 deletions
|
@ -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(),
|
||||||
|
|
Loading…
Reference in a new issue