Skip to content

waitForBlock is incorrect #2716

@jeapostrophe

Description

@jeapostrophe

waitForBlock does not wait for the given block, but waits for the next block:

https://github.com/algorand/go-algorand/blob/master/daemon/algod/api/server/v2/handlers.go#L328
https://github.com/algorand/go-algorand/blob/master/daemon/algod/api/server/v1/handlers/handlers.go#L629

Even though the end-point is named "wait-for-block-after", the docs say --- https://developer.algorand.org/docs/reference/rest-apis/algod/v2/#get-v2statuswait-for-block-afterround --- "Gets the node status after waiting for the given round." meaning "/v2/status/wait-for-block/after/5" means "Gets the node status after waiting for round 5" (and that's the way the Indexer uses it)

This is easy to fix, just remove the + 1 on those two lines.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions