dash/src
Wladimir J. van der Laan a76bafb98c Merge #16046: util: Add type safe GetTime
fa013664ae23d0682a195b9bded85bc19c99536e util: Add type safe GetTime (MarcoFalke)

Pull request description:

  There are basically two ways to get the time in Bitcoin Core:
  * get the system time (via `GetSystemTimeInSeconds` or `GetTime{Millis,Micros}`)
  * get the mockable time (via `GetTime`)

  Both return the same type (a plain int). This can lead to (test-only) bugs such as 99464bc38e.

  Fix that by deprecating `GetTime` and adding a `GetTime<>` that returns the mockable time in a non-int type. The new util function is currently unused, but new code should it where possible.

ACKs for commit fa0136:
  promag:
    utACK fa013664.

Tree-SHA512: efab9c463f079fd8fd3030c479637c7b1e8be567a881234bd0f555c8f87e518e3b43ef2466128103db8fc40295aaf24e87ad76d91f338c631246fc703477e95c
2020-04-08 14:50:07 +02:00
..
bench Merge #16046: util: Add type safe GetTime 2020-04-08 14:50:07 +02:00
bls Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
compat Merge #12998: Default to defining endian-conversion DECLs in compat w/o config 2020-04-03 04:10:53 -05:00
config
consensus Implement new way of concentrated signature recovery 2020-03-31 19:58:07 +02:00
crypto Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
evo Use Params().RequireRoutableExternalIP() wherever possible 2020-03-31 07:21:12 +02:00
governance Also remove m_tx_announced and m_tx_in_flight entries when EraseObjectRequest is called 2020-04-07 13:25:29 +02:00
immer
leveldb Merge #12518: [0.16] Bump leveldb subtree 2020-03-24 11:43:10 -05:00
llmq Also remove m_tx_announced and m_tx_in_flight entries when EraseObjectRequest is called 2020-04-07 13:25:29 +02:00
masternode Use !fMasternode to disable restart of mnsync instead of checking for regtest 2020-03-31 19:53:46 +02:00
obj
obj-test
policy Merge #10574: Remove includes in .cpp files for things the corresponding .h file already included 2020-04-01 12:43:18 -05:00
primitives Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
privatesend Make pending masternode queue proTxHash based 2020-03-20 17:16:24 +01:00
qt fix 2020-04-05 11:06:11 -05:00
rpc Merge #13184: RPC Docs: gettxout*: clarify bestblock and unspent counts 2020-04-03 04:15:47 -05:00
script Merge #10699: Make all script validation flags backward compatible 2020-04-05 11:06:13 -05:00
secp256k1 Merge #15703: Update secp256k1 subtree to latest upstream 2020-03-14 11:01:03 -05:00
support Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
test Merge #16046: util: Add type safe GetTime 2020-04-08 14:50:07 +02:00
univalue Merge #17324: Update univalue subtree 2020-03-14 11:03:02 -05:00
wallet Merge #11904: Add a lock to the wallet directory 2020-04-01 12:43:18 -05:00
zmq Merge #10493: Use range-based for loops (C++11) when looping over map elements 2020-04-01 12:43:18 -05:00
.clang-format
addrdb.cpp Merge #10574: Remove includes in .cpp files for things the corresponding .h file already included 2020-04-01 12:43:18 -05:00
addrdb.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
addressindex.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
addrman.cpp Merge #10493: Use range-based for loops (C++11) when looping over map elements 2020-04-01 12:43:18 -05:00
addrman.h Merge #10493: Use range-based for loops (C++11) when looping over map elements 2020-04-01 12:43:18 -05:00
amount.h
arith_uint256.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
arith_uint256.h Merge #10749: Use compile-time constants instead of unnamed enumerations (remove "enum hack") 2020-01-22 09:24:25 -06:00
base58.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
base58.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
batchedlogger.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
batchedlogger.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
bip39_english.h
bip39.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
bip39.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
blockencodings.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
blockencodings.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
bloom.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
bloom.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
cachemap.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
cachemultimap.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
chain.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
chain.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
chainparams.cpp Merge pull request #3389 from codablock/pr_concentrated_recovery 2020-04-02 13:59:05 +02:00
chainparams.h Move LLMQ connection retry timeout into chainparams 2020-03-21 12:21:09 +01:00
chainparamsbase.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
chainparamsbase.h
chainparamsseeds.h Update static and dns seeds for mainnet and testnet (#3234) 2019-12-11 12:30:38 +01:00
checkpoints.cpp Merge #10574: Remove includes in .cpp files for things the corresponding .h file already included 2020-04-01 12:43:18 -05:00
checkpoints.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
checkqueue.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
clientversion.cpp Merge #10574: Remove includes in .cpp files for things the corresponding .h file already included 2020-04-01 12:43:18 -05:00
clientversion.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
coins.cpp Merge #10574: Remove includes in .cpp files for things the corresponding .h file already included 2020-04-01 12:43:18 -05:00
coins.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
compat.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
compressor.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
compressor.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
core_io.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
core_memusage.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
core_read.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
core_write.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
ctpl.h
cuckoocache.h Merge #10969: Declare single-argument (non-converting) constructors "explicit" 2020-01-10 10:33:57 -06:00
cxxtimer.hpp
dash-cli-res.rc
dash-cli.cpp Merge pull request #3361 from PastaPastaPasta/backports-0.16-pr11 2020-03-20 01:47:53 +03:00
dash-tx-res.rc
dash-tx.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
dashd-res.rc
dashd.cpp Merge #12266: Move scheduler/threadGroup into common-init instead of per-app 2020-03-23 12:42:14 +01:00
dbwrapper.cpp Merge #10574: Remove includes in .cpp files for things the corresponding .h file already included 2020-04-01 12:43:18 -05:00
dbwrapper.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
dsnotificationinterface.cpp Fix issues introduced with asynchronous signal handling (#3369) 2020-03-20 19:11:54 +03:00
dsnotificationinterface.h Fix issues introduced with asynchronous signal handling (#3369) 2020-03-20 19:11:54 +03:00
flat-database.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
fs.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
fs.h
hash.cpp Merge #11884: Remove unused include in hash.cpp 2020-03-24 11:43:10 -05:00
hash.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
hdchain.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
hdchain.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
httprpc.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
httprpc.h
httpserver.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
httpserver.h Merge #10969: Declare single-argument (non-converting) constructors "explicit" 2020-01-10 10:33:57 -06:00
indirectmap.h
init.cpp Merge pull request #3387 from PastaPastaPasta/backports-0.16-pr13 2020-04-03 02:31:23 +03:00
init.h Merge #12266: Move scheduler/threadGroup into common-init instead of per-app 2020-03-23 12:42:14 +01:00
keepass.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
keepass.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
key.cpp Merge #10574: Remove includes in .cpp files for things the corresponding .h file already included 2020-04-01 12:43:18 -05:00
key.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
keystore.cpp Merge #11667: Add scripts to dumpwallet RPC 2020-04-01 12:43:18 -05:00
keystore.h Merge #11667: Add scripts to dumpwallet RPC 2020-04-01 12:43:18 -05:00
limitedmap.h Fix undefined behaviour in unordered_limitedmap and optimise it. (#3349) 2020-03-01 16:24:03 +03:00
Makefile.am Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
Makefile.bench.include Merge #16046: util: Add type safe GetTime 2020-04-08 14:50:07 +02:00
Makefile.leveldb.include
Makefile.qt.include Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
Makefile.qttest.include Merge #13408: crypto: cleanup sha256 build 2019-10-01 23:20:06 +02:00
Makefile.test.include Merge pull request #3361 from PastaPastaPasta/backports-0.16-pr11 2020-03-20 01:47:53 +03:00
memusage.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
merkleblock.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
merkleblock.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
messagesigner.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
messagesigner.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
miner.cpp Merge #10574: Remove includes in .cpp files for things the corresponding .h file already included 2020-04-01 12:43:18 -05:00
miner.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
net_processing.cpp More logging for object request handling 2020-04-07 13:26:47 +02:00
net_processing.h Also remove m_tx_announced and m_tx_in_flight entries when EraseObjectRequest is called 2020-04-07 13:25:29 +02:00
net.cpp Replace uses of CConnman::RemoveAskFor with EraseObjectRequest 2020-04-07 07:14:42 +02:00
net.h Replace uses of CConnman::RemoveAskFor with EraseObjectRequest 2020-04-07 07:14:42 +02:00
netaddress.cpp Merge #10574: Remove includes in .cpp files for things the corresponding .h file already included 2020-04-01 12:43:18 -05:00
netaddress.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
netbase.cpp Merge #10574: Remove includes in .cpp files for things the corresponding .h file already included 2020-04-01 12:43:18 -05:00
netbase.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
netfulfilledman.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
netfulfilledman.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
netmessagemaker.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
noui.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
noui.h
pow.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
pow.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
prevector.h Speed up prevector initialization and vector assignment from prevectors (#3274) 2020-01-08 08:02:17 +01:00
protocol.cpp Implement new way of concentrated signature recovery 2020-03-31 19:58:07 +02:00
protocol.h Implement new way of concentrated signature recovery 2020-03-31 19:58:07 +02:00
pubkey.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
pubkey.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
random.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
random.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
rest.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
reverse_iterator.h Merge #10969: Declare single-argument (non-converting) constructors "explicit" 2020-01-10 10:33:57 -06:00
reverselock.h
saltedhasher.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
saltedhasher.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
scheduler.cpp Merge #11824: Block ActivateBestChain to empty validationinterface queue 2020-03-24 17:21:59 +03:00
scheduler.h Merge #11824: Block ActivateBestChain to empty validationinterface queue 2020-03-24 17:21:59 +03:00
serialize.h Merge #10493: Use range-based for loops (C++11) when looping over map elements 2020-04-01 12:43:18 -05:00
spentindex.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
spork.cpp Also remove m_tx_announced and m_tx_in_flight entries when EraseObjectRequest is called 2020-04-07 13:25:29 +02:00
spork.h Add SPORK_21_QUORUM_ALL_CONNECTED 2020-03-27 15:12:20 +01:00
stacktraces.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
stacktraces.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
streams.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
sync.cpp Merge #11722: Switched sync.{cpp,h} to std threading primitives. 2020-03-24 11:43:10 -05:00
sync.h Merge #11722: Switched sync.{cpp,h} to std threading primitives. 2020-03-24 11:43:10 -05:00
threadinterrupt.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
threadinterrupt.h
threadsafety.h
timedata.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
timedata.h
tinyformat.h Merge #11573: [Util] Update tinyformat.h 2020-01-16 09:22:46 -06:00
torcontrol.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
torcontrol.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
txdb.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
txdb.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
txmempool.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
txmempool.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
ui_interface.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
ui_interface.h Merge #10770: Drop upgrade-cancel callback registration for a generic "cancelable" 2020-01-03 08:35:55 -06:00
uint256.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
uint256.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
undo.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
unordered_lru_cache.h Bump copyright year to 2020 (#3290) 2020-01-17 15:42:55 +01:00
util.cpp Merge #12422: util: Make LockDirectory thread-safe, consistent, and fix OpenBSD 6.2 build 2020-04-03 04:00:42 -05:00
util.h Merge #12422: util: Make LockDirectory thread-safe, consistent, and fix OpenBSD 6.2 build 2020-04-03 04:00:42 -05:00
utilmoneystr.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
utilmoneystr.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
utilstrencodings.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
utilstrencodings.h Merge #10357: Allow setting nMinimumChainWork on command line 2019-09-29 12:42:14 +02:00
utiltime.cpp Merge #16046: util: Add type safe GetTime 2020-04-08 14:50:07 +02:00
utiltime.h Merge #16046: util: Add type safe GetTime 2020-04-08 14:50:07 +02:00
validation.cpp Merge #10574: Remove includes in .cpp files for things the corresponding .h file already included 2020-04-01 12:43:18 -05:00
validation.h Merge pull request #3361 from PastaPastaPasta/backports-0.16-pr11 2020-03-20 01:47:53 +03:00
validationinterface.cpp Merge #11824: Block ActivateBestChain to empty validationinterface queue 2020-03-24 17:21:59 +03:00
validationinterface.h Merge #11824: Block ActivateBestChain to empty validationinterface queue 2020-03-24 17:21:59 +03:00
version.h Verify min proto version and open ports of LLMQ members and vote on bad ones 2020-03-31 07:07:52 +02:00
versionbits.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
versionbits.h Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
warnings.cpp Backport 11651 (#3358) 2020-03-20 01:46:56 +03:00
warnings.h Merge #10501: remove some unused functions -- ignoring removal of SetPort due to dash#2168 2019-09-08 00:10:48 -05:00