| 2078 | } |
| 2079 | |
| 2080 | bool 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 | |
| 2097 | NodeClock::time_point CWallet::GetDefaultNextResend() { return FastRandomContext{}.rand_uniform_delay(NodeClock::now() + 12h, 24h); } |
| 2098 |
no test coverage detected