This PR addresses the outstanding comments/issues from #25768:
- capitalization typo in docstring
- remove unused locks that we previously needed for
ReacceptWalletTransactions() - before #25768, only
ResendWalletTransactions()would resetm_next_resend(formerly callednNextResend). By unifying it withReacceptWalletTransactions()intoResubmitWalletTransactions(), the number of callsites that would reset them_next_resendtimer increased- since
m_next_resendis only used in case ofrelay=true(formerlyResendWalletTransactions()), this is unintuitive - it leads to unexpected behaviour such as transactions potentially never being rebroadcasted.
- it makes the ResubmitWalletTransactions()` logic more complicated than strictly necessary
- since #25768, we relied on an earlier call of
ResubmitWalletTransactions(relay=false, force=true)to initializem_next_resend(), I think we can more elegantly do that by just providingm_next_resendwith a default value - just to highlight: this commit introduces behaviour change
- since
Note: the if (!fBroadcastTransactions) in CWallet:ShouldResend() is duplicated on purpose, since it potentially avoids the slightly more expensive if (!chain().isReadyToBroadcast()) check afterwards. I don’t have a strong view on it, so happy to remove that additional check to reduce the diff, too.