Page MenuHomePhabricator

Restrict setmocktime to non-negative integers
ClosedPublic

Authored by jasonbcox on May 10 2020, 20:19.

Details

Summary

The assumption that now > 0 is applied throughout util/time.cpp,
so there's no reason to expect setting mock time to a negative int to be valid.

Test Plan

ninja check check-functional

Diff Detail

Repository
rABC Bitcoin ABC
Branch
neg-mocktime
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 10690
Build 19177: Default Diff Build & Tests
Build 19176: arc lint + arc unit

Event Timeline

Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/rpc/misc.cpp
336 ↗(On Diff #19876)

Nit: "Timestamp must be a positive integer" tells what it should be rather that what is should not be.

This revision is now accepted and ready to land.May 11 2020, 07:23

Tweaked error message text