diff options
author | fanquake <fanquake@gmail.com> | 2022-10-24 10:00:57 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-10-24 10:11:13 +0800 |
commit | 50cc8ef5a72b927cd30f12e6583cad85c43d3c01 (patch) | |
tree | 9de03dbf789cac1633007cbbd52d969c4b0e05c2 /src/wallet/wallet.cpp | |
parent | 6d4048468430d9d1fe5e7c5fcda13708879d1083 (diff) | |
parent | fa51cc965110e14661c848364a29c493287673be (diff) | |
download | bitcoin-50cc8ef5a72b927cd30f12e6583cad85c43d3c01.tar.xz |
Merge bitcoin/bitcoin#26302: refactor: Use type-safe time point for CWallet::m_next_resend
fa51cc965110e14661c848364a29c493287673be refactor: Use type-safe time point for CWallet::m_next_resend (MacroFake)
Pull request description:
`GetTime` is not type-safe, thus deprecated, see https://github.com/bitcoin/bitcoin/blob/75cbbfa279685f70d9f6fa71432df00862ffa865/src/util/time.h#L62-L70
ACKs for top commit:
shaavan:
Code Review ACK fa51cc965110e14661c848364a29c493287673be
aureleoules:
ACK fa51cc965110e14661c848364a29c493287673be
Tree-SHA512: 030de10070518580763ea75079442e2f934c54d3083be3ebe35e7f1bc6db2096745bb46d95aa1e6efe29ced30a048acfe5cd999178e6787b7647dfbec5ecb444
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r-- | src/wallet/wallet.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 671c432b10..e2c8f6eda3 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1916,12 +1916,12 @@ bool CWallet::ShouldResend() const // Do this infrequently and randomly to avoid giving away // that these are our transactions. - if (GetTime() < m_next_resend) return false; + if (NodeClock::now() < m_next_resend) return false; return true; } -int64_t CWallet::GetDefaultNextResend() { return GetTime() + (12 * 60 * 60) + GetRand(24 * 60 * 60); } +NodeClock::time_point CWallet::GetDefaultNextResend() { return FastRandomContext{}.rand_uniform_delay(NodeClock::now() + 12h, 24h); } // Resubmit transactions from the wallet to the mempool, optionally asking the // mempool to relay them. On startup, we will do this for all unconfirmed |