mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 11:41:19 +00:00
console: fix admin.sleepBlocks (#21629)
This commit is contained in:
parent
865e01a1a5
commit
1bbd51d31b
@ -356,14 +356,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 {
|
||||
|
Loading…
Reference in New Issue
Block a user