Skip to content

Commit

Permalink
console: fix admin.sleepBlocks (#21629)
Browse files Browse the repository at this point in the history
  • Loading branch information
de1acr0ix authored Oct 13, 2020
1 parent 66c3eb2 commit 32341f8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions console/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,14 @@ func (b *bridge) SleepBlocks(call jsre.Call) (goja.Value, error) {
}

// Poll the current block number until either it or a timeout is reached.
var (
deadline = time.Now().Add(time.Duration(sleep) * time.Second)
lastNumber = ^hexutil.Uint64(0)
)
deadline := time.Now().Add(time.Duration(sleep) * time.Second)
var lastNumber hexutil.Uint64
if err := b.client.Call(&lastNumber, "eth_blockNumber"); err != nil {
return nil, err
}
for time.Now().Before(deadline) {
var number hexutil.Uint64
err := b.client.Call(&number, "eth_blockNumber")
if err != nil {
if err := b.client.Call(&number, "eth_blockNumber"); err != nil {
return nil, err
}
if number != lastNumber {
Expand Down

0 comments on commit 32341f8

Please sign in to comment.