network/consensus: always process dBFT messages as high priority

Move category definition from consensus to payload, consensus service is the
one of its kind (HP), so network.Server can be adjusted accordingly.
This commit is contained in:
Roman Khimov 2022-07-28 18:30:14 +03:00
parent ff93a680eb
commit 9b0ea2c21b
8 changed files with 20 additions and 26 deletions

View file

@ -423,7 +423,7 @@ func mkConsensus(config config.Wallet, tpb time.Duration, chain *core.Blockchain
return nil, fmt.Errorf("can't initialize Consensus module: %w", err)
}
serv.AddExtensibleHPService(srv, consensus.Category, srv.OnPayload, srv.OnTransaction)
serv.AddConsensusService(srv, srv.OnPayload, srv.OnTransaction)
return srv, nil
}
@ -606,7 +606,7 @@ Main:
}
case sigusr2:
if dbftSrv != nil {
serv.DelExtensibleHPService(dbftSrv, consensus.Category)
serv.DelConsensusService(dbftSrv)
dbftSrv.Shutdown()
}
dbftSrv, err = mkConsensus(cfgnew.ApplicationConfiguration.UnlockWallet, serverConfig.TimePerBlock, chain, serv, log)