MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ShouldResend

Method ShouldResend

src/wallet/wallet.cpp:2080–2095  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2078}
2079
2080bool CWallet::ShouldResend() const
2081{
2082 // Don't attempt to resubmit if the wallet is configured to not broadcast
2083 if (!fBroadcastTransactions) return false;
2084
2085 // During reindex, importing and IBD, old wallet transactions become
2086 // unconfirmed. Don't resend them as that would spam other nodes.
2087 // We only allow forcing mempool submission when not relaying to avoid this spam.
2088 if (!chain().isReadyToBroadcast()) return false;
2089
2090 // Do this infrequently and randomly to avoid giving away
2091 // that these are our transactions.
2092 if (NodeClock::now() < m_next_resend) return false;
2093
2094 return true;
2095}
2096
2097NodeClock::time_point CWallet::GetDefaultNextResend() { return FastRandomContext{}.rand_uniform_delay(NodeClock::now() + 12h, 24h); }
2098

Callers 1

MaybeResendWalletTxsFunction · 0.80

Calls 1

isReadyToBroadcastMethod · 0.80

Tested by

no test coverage detected