mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 23:56:43 +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
|
||||
// checkpoint whitelist map.
|
||||
func (s *Ethereum) startCheckpointWhitelistService() {
|
||||
// a shortcut helps with tests and early exit
|
||||
select {
|
||||
case <-s.closeCh:
|
||||
return
|
||||
default:
|
||||
}
|
||||
|
||||
// first run the checkpoint whitelist
|
||||
err := s.handleWhitelistCheckpoint()
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -37,10 +37,18 @@ func TestInsertingSpanSizeBlocks(t *testing.T) {
|
|||
engine := init.ethereum.Engine()
|
||||
_bor := engine.(*bor.Bor)
|
||||
|
||||
defer engine.Close()
|
||||
|
||||
h, heimdallSpan, ctrl := getMockedHeimdallClient(t)
|
||||
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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue