mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-13 07:23:46 +00:00
fix
This commit is contained in:
parent
01b6d6cb72
commit
208133b6da
2 changed files with 16 additions and 1 deletions
|
|
@ -598,6 +598,13 @@ func (s *Ethereum) Start() error {
|
||||||
// StartCheckpointWhitelistService starts the goroutine to fetch checkpoints and update the
|
// StartCheckpointWhitelistService starts the goroutine to fetch checkpoints and update the
|
||||||
// checkpoint whitelist map.
|
// checkpoint whitelist map.
|
||||||
func (s *Ethereum) startCheckpointWhitelistService() {
|
func (s *Ethereum) startCheckpointWhitelistService() {
|
||||||
|
// a shortcut helps with tests and early exit
|
||||||
|
select {
|
||||||
|
case <-s.closeCh:
|
||||||
|
return
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
|
||||||
// first run the checkpoint whitelist
|
// first run the checkpoint whitelist
|
||||||
err := s.handleWhitelistCheckpoint()
|
err := s.handleWhitelistCheckpoint()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,18 @@ func TestInsertingSpanSizeBlocks(t *testing.T) {
|
||||||
engine := init.ethereum.Engine()
|
engine := init.ethereum.Engine()
|
||||||
_bor := engine.(*bor.Bor)
|
_bor := engine.(*bor.Bor)
|
||||||
|
|
||||||
|
defer engine.Close()
|
||||||
|
|
||||||
h, heimdallSpan, ctrl := getMockedHeimdallClient(t)
|
h, heimdallSpan, ctrl := getMockedHeimdallClient(t)
|
||||||
defer ctrl.Finish()
|
defer ctrl.Finish()
|
||||||
|
|
||||||
h.EXPECT().FetchLatestCheckpoint().Return(&bor.Checkpoint{}, nil).AnyTimes()
|
_, span := loadSpanFromFile(t)
|
||||||
|
|
||||||
|
h.EXPECT().FetchLatestCheckpoint().Return(&bor.Checkpoint{
|
||||||
|
Proposer: span.SelectedProducers[0].Address,
|
||||||
|
StartBlock: big.NewInt(0),
|
||||||
|
EndBlock: big.NewInt(int64(spanSize)),
|
||||||
|
}, nil).Times(1)
|
||||||
|
|
||||||
_bor.SetHeimdallClient(h)
|
_bor.SetHeimdallClient(h)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue