WaitForNextBlock waits for the next block to be committed, returning an error upon failure.
()
| 533 | // WaitForNextBlock waits for the next block to be committed, returning an error |
| 534 | // upon failure. |
| 535 | func (n *Network) WaitForNextBlock() error { |
| 536 | lastBlock, err := n.LatestHeight() |
| 537 | if err != nil { |
| 538 | return err |
| 539 | } |
| 540 | |
| 541 | _, err = n.WaitForHeight(lastBlock + 1) |
| 542 | if err != nil { |
| 543 | return err |
| 544 | } |
| 545 | |
| 546 | return err |
| 547 | } |
| 548 | |
| 549 | // WaitForBlocks waits for the next amount of blocks to be committed, returning an error |
| 550 | // upon failure. |