Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

account_history RPC count parameter still considers change blocks even though they aren't returned #1270

Closed
meltingice opened this issue Oct 7, 2018 · 4 comments

Comments

Projects
None yet
4 participants
@meltingice
Copy link

commented Oct 7, 2018

When calling the account_history RPC, legacy change blocks are still considered against the count parameter even though they aren't returned.

How to Reproduce

The account xrb_1x7biz69cem95oo7gxkrw6kzhfywq4x5dupw4z1bdzkb74dk9kpxwzjbdhhs has 2 change blocks at the head of its chain. When calling account_history with a count of 2, the RPC returns no blocks.

curl -d '{"action": "account_history", "account": "xrb_1x7biz69cem95oo7gxkrw6kzhfywq4x5dupw4z1bdzkb74dk9kpxwzjbdhhs", "count": "2"}' 10.0.1.152:7076
{
    "account": "xrb_1x7biz69cem95oo7gxkrw6kzhfywq4x5dupw4z1bdzkb74dk9kpxwzjbdhhs",
    "history": "",
    "previous": "A328DCFEB1B6C9E01D08DFD293A07038D490753B05C30E053A2C032FB457B65A"
}

When supplying a count of 3, you can finally get a block in the response.

curl -d '{"action": "account_history", "account": "xrb_1x7biz69cem95oo7gxkrw6kzhfywq4x5dupw4z1bdzkb74dk9kpxwzjbdhhs", "count": "3"}' 10.0.1.152:7076
{
    "account": "xrb_1x7biz69cem95oo7gxkrw6kzhfywq4x5dupw4z1bdzkb74dk9kpxwzjbdhhs",
    "history": [
        {
            "type": "receive",
            "account": "xrb_3uf1d9zptbxt5k6n7pe46g9ok4hrnazj4zq4zi158tsnremgkp7eycrdj951",
            "amount": "30212000000000000000000000000",
            "hash": "A328DCFEB1B6C9E01D08DFD293A07038D490753B05C30E053A2C032FB457B65A"
        }
    ],
    "previous": "8D5D966F3622DFE0449B324A5393691A58B400FA3503AC1F733498C560958140"
}

Expected Behavior

The count parameter does not consider blocks that it doesn't return in the response.

@argakiig

This comment has been minimized.

Copy link
Collaborator

commented Oct 7, 2018

Are you expecting changes to be included or just change what the count is counting?

@meltingice

This comment has been minimized.

Copy link
Author

commented Oct 7, 2018

It's fine that it doesn't include change blocks since that's documented and you can get them if you set "raw": "true". I'd rather see the count behavior changed so that it only considers blocks that you are expecting to get in the response.

@Guillerbr

This comment has been minimized.

Copy link

commented Oct 7, 2018

ok

@rkeene

This comment has been minimized.

Copy link
Contributor

commented Oct 12, 2018

Fixed by #1293

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.