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

Ensure the block exists in account_history #1410

Merged
merged 2 commits into from Nov 29, 2018

Conversation

Projects
2 participants
@rkeene
Copy link
Contributor

commented Nov 27, 2018

When calling account_history with a block that does not exist, it currently fails to find the block resulting in dereferencing a NULL pointer.

This change makes it return an error. Another option is to make it return an empty history for the hash.

@rkeene rkeene added the bug label Nov 27, 2018

@rkeene rkeene added this to the V18.0 milestone Nov 27, 2018

@rkeene rkeene self-assigned this Nov 27, 2018

@rkeene rkeene requested a review from SergiySW Nov 27, 2018

@clemahieu
Copy link
Collaborator

left a comment

I prefer this method with an error since an empty result is more in line with a correct request which this isn’t.

Show resolved Hide resolved rai/node/rpc.cpp Outdated

@rkeene rkeene merged commit 652f4c1 into nanocurrency:master Nov 29, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@zhyatt zhyatt added this to Unscheduled in V18 Dec 27, 2018

@zhyatt zhyatt moved this from Unscheduled to CP 0 in V18 Jan 4, 2019

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.