algorand / algorand/go-algorand

GET /v2/transactions/pending returns empty array after a catchup

Open
#3,743 0 comments 0 reactions 0 assignees View on GitHub
bug Team Carbon-11 Team Lamprey
Dominant language
Go
Stars
1.4k
Forks
537
Avg merge
1d 7h
Merged PRs (30d)
18

Description

### Subject of the issue

When a node is brought up for the first time or after a period of being down and a catchup is performed, it doesn't appear to return the pending transactions after it's finished syncing. It can easily be resolved by bringing the node down and up again, but I imagine there's something preventing it from working straight away. This has been experienced in both sandbox and a local node.

### Your environment

All versions I've used over the months. Currently:

3.4.2.dev [rel/stable] (commit #54c3c397)
go-algorand is licensed with AGPLv3.0
source code available at https://github.com/algorand/go-algorand

macOS Monterey 12.2.1

### Steps to reproduce

1. `./sandbox clean`
2. `./sandbox up mainnet -v`
\*wait for catchup to complete\*
3. Check sync status `./sandbox goal node status -w 100`
\*wait until synced\*
4. `curl localhost:4001/v2/transactions/pending -H "X-Algo-API-Token: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"`
```
{
"top-transactions": [],
"total-transactions": 0
}
```
5. `./sandbox down`
6. `./sandbox up`
7. `curl localhost:4001/v2/transactions/pending -H "X-Algo-API-Token: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"`
```
{
"top-transactions": [
...txns now being returned...
],
"total-transactions": 72
}
```

### Expected behaviour

I'd expect pending transactions to be available once the node has caught up without restarting it.

### Actual behaviour

Restarting the node is required for the pending transactions to be returned.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.