0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-11 15:56:58 -04:00
bitcoin-core/src/wallet/rpc
fanquake aa6fb37acc
Merge bitcoin/bitcoin#26205: wallet: #25768 follow ups
b01682a812 refactor: revert m_next_resend to not be std::atomic (stickies-v)
9245f45670 wallet: only update m_next_resend when actually resending (stickies-v)
7fbde8af5c refactor: carve out tx resend timer logic into ShouldResend (stickies-v)
01f3534632 refactor: remove unused locks for ResubmitWalletTransactions (stickies-v)
c6e8e11fb0 wallet: fix capitalization in docstring (stickies-v)

Pull request description:

  This PR addresses the outstanding comments/issues from #25768:

  - capitalization [typo](https://github.com/bitcoin/bitcoin/pull/25768#discussion_r958572522) in docstring
  - remove [unused locks](01f3534632) that we previously needed for `ReacceptWalletTransactions()`
  - before #25768, only `ResendWalletTransactions()` would reset `m_next_resend` (formerly called `nNextResend`). By unifying it with `ReacceptWalletTransactions()` into `ResubmitWalletTransactions()`, the number of callsites that would reset the `m_next_resend` timer increased
    - since `m_next_resend` is only used in case of `relay=true` (formerly `ResendWalletTransactions()`), this is unintuitive
    - it leads to [unexpected behaviour](https://github.com/bitcoin/bitcoin/pull/25768#issuecomment-1252619427) such as transactions potentially never being rebroadcasted.
    - it makes the ResubmitWalletTransactions()` logic [more complicated than strictly necessary](https://github.com/bitcoin/bitcoin/pull/25768#discussion_r962828563)
    - since #25768, we relied on an earlier call of `ResubmitWalletTransactions(relay=false, force=true)` to initialize `m_next_resend()`, I think we can more elegantly do that by just providing `m_next_resend` with a default value
    - just to highlight: this commit introduces behaviour change

  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.

ACKs for top commit:
  aureleoules:
    ACK b01682a812
  achow101:
    ACK b01682a812

Tree-SHA512: ac5f1d8858f8dd736dd1480f385984d660c1916b62a42562317020e8f9fd6a30bd8f23d973d47e4c9480d744c5ba39fdbefd69568a5eb0589a8422d7e5971c1c
2022-10-13 12:09:44 +08:00
..
addresses.cpp script/sign: remove needless IsSolvable() utility 2022-08-11 15:43:40 +02:00
backup.cpp Merge bitcoin/bitcoin#26205: wallet: #25768 follow ups 2022-10-13 12:09:44 +08:00
coins.cpp Merge bitcoin/bitcoin#26074: refactor: Set RPCArg options with designated initializers 2022-09-30 10:06:14 +02:00
encrypt.cpp scripted-diff: Replace NullUniValue with UniValue::VNULL 2022-07-25 17:27:53 +02:00
signmessage.cpp scripted-diff: Replace NullUniValue with UniValue::VNULL 2022-07-25 17:27:53 +02:00
spend.cpp Merge bitcoin/bitcoin#26074: refactor: Set RPCArg options with designated initializers 2022-09-30 10:06:14 +02:00
transactions.cpp fixups for BIP125 doc cleanup 2022-08-22 14:59:58 +01:00
util.cpp refactor: move Boost datetime usage to wallet 2022-10-01 11:41:53 +01:00
util.h refactor: move Boost datetime usage to wallet 2022-10-01 11:41:53 +01:00
wallet.cpp Add migratewallet RPC 2022-08-29 17:30:38 -04:00
wallet.h Add src/wallet/* code to wallet:: namespace 2022-01-06 22:14:16 -05:00