diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-03-17 16:34:42 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-03-17 16:34:53 -0400 |
commit | ce87d5613a5537b68cf23e7bc25c1e3770704ff9 (patch) | |
tree | f5841e32a5cd526e889900cebbfd9f0f38018edb /src/banman.h | |
parent | 39497d1f3268d3aa75a41d07a5a5442a463265c6 (diff) | |
parent | fa36f3a29538012a6eb5c3402b3b3c18fd32b230 (diff) | |
download | bitcoin-ce87d5613a5537b68cf23e7bc25c1e3770704ff9.tar.xz |
Merge #18289: refactor: Make scheduler methods type safe
fa36f3a29538012a6eb5c3402b3b3c18fd32b230 refactor: move DUMP_BANS_INTERVAL to banman.h (MarcoFalke)
fadafb83cff9a9a340eac1b5a853e2467d5e0ef7 scheduler: Make schedule* methods type safe (MarcoFalke)
fa70ccc6c4e304646b4610228f3975b3a9762643 scheduler: Use C++11 member initialization, add shutdown assert (MarcoFalke)
Pull request description:
Main benefit is that stuff like `15 * 60 * 1000` is replaced by `minutes{15}`
ACKs for top commit:
vasild:
ACK fa36f3a (code review, not tested)
ajtowns:
ACK fa36f3a29538012a6eb5c3402b3b3c18fd32b230
jonatack:
ACK fa36f3a
Tree-SHA512: f35f1a1d643dfa676bd47474659f6492ed05cca04cdb556064b126f654a6a44a4b93fcaddcdcd41faf81b8f11439c11e5c7ab88685ba2eef12f7188843d17ad8
Diffstat (limited to 'src/banman.h')
-rw-r--r-- | src/banman.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/banman.h b/src/banman.h index 8984874914..6bea2e75e9 100644 --- a/src/banman.h +++ b/src/banman.h @@ -5,16 +5,19 @@ #ifndef BITCOIN_BANMAN_H #define BITCOIN_BANMAN_H -#include <cstdint> -#include <memory> - #include <addrdb.h> #include <fs.h> #include <net_types.h> // For banmap_t #include <sync.h> +#include <chrono> +#include <cstdint> +#include <memory> + // NOTE: When adjusting this, update rpcnet:setban's help ("24h") static constexpr unsigned int DEFAULT_MISBEHAVING_BANTIME = 60 * 60 * 24; // Default 24-hour ban +// How often to dump addresses to banlist.dat +static constexpr std::chrono::minutes DUMP_BANS_INTERVAL{15}; class CClientUIInterface; class CNetAddr; |