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

Previous slot’s firestone is lost when rollback. #60

Open
HarvestStars opened this issue Feb 4, 2020 · 0 comments
Open

Previous slot’s firestone is lost when rollback. #60

HarvestStars opened this issue Feb 4, 2020 · 0 comments

Comments

@HarvestStars
Copy link
Contributor

There is a scene in which the firestone disappears into view.

Environment:
lavad version v0.3.4.

details:
At the end of slot N-1, Alice buys a firestone(marked as F, the transaction is T), so that the firestone F could be usable in slot N. However, the blockchain rolls back at this moment, leading to the transaction T is packed in slot N.
Then, T migrates from slot N-1 to slot N, and F is lost in our rpc of listfirestone

code
here is the problem code

bool TestTicket(const int height, const CTicketRef ticket)
{
    auto index = pticketview->SlotIndex();
    auto len = pticketview->SlotLength();
    if (ticket->LockTime() != ((index + 1) * len -1)) {
        return false;
    }
    if (ticket->nValue != pticketview->CurrentTicketPrice()) {
        return false;
    }
    return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant