Skip to content

Use saturating arithmetic in UpdateForBatchPosterSpending #740

Closed

Description

@edfelten

UpdateForBatchPosterSpending includes some arithmetic that should be safe from overflow, given the realistic bounds on timestamps. But a more careful approach, which we should adopt, is to make the code unconditionally safe against weird timestamp values, by adopting saturating arithmetic or adding checks.

This is technically speaking a change to consensus code, but there should be no difference in any practical case that has been encountered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions