[wallet] Refactor relay transactions #15728

pull jnewbery wants to merge 1 commits into bitcoin:master from jnewbery:2019_03_refactor_relay_transactions changing 2 files +20 −15
  1. jnewbery commented at 1:46 pm on April 3, 2019: member

    Refactor CWalletTx::RelayWalletTransaction() function.

    This was a suggestion from the wallet-node separation PR: #15288 (review), which we deferred until after the main PR was merged.

    There are also makes two minor behavior changes:

    • no longer assert if fBroadcastTransactions is false. Just return false from the function.
    • no longer print the relay message if p2pEnabled is set to false (since the transaction is not actually relayed).
  2. jnewbery commented at 1:46 pm on April 3, 2019: member

    The first three commits are from #15632. Please review that PR first.

    Base PR has been merged. This is ready for review.

  3. fanquake added the label Wallet on Apr 3, 2019
  4. in src/wallet/wallet.cpp:1903 in afb608b1e9 outdated
    1895@@ -1896,20 +1896,25 @@ void CWallet::ReacceptWalletTransactions(interfaces::Chain::Lock& locked_chain)
    1896 
    1897 bool CWalletTx::RelayWalletTransaction(interfaces::Chain::Lock& locked_chain)
    1898 {
    1899-    assert(pwallet->GetBroadcastTransactions());
    1900-    if (!IsCoinBase() && !isAbandoned() && GetDepthInMainChain(locked_chain) == 0)
    1901-    {
    1902-        CValidationState state;
    1903-        /* GetDepthInMainChain already catches known conflicts. */
    


    promag commented at 2:17 pm on April 3, 2019:
    Could keep this comment?

    jnewbery commented at 2:42 pm on April 3, 2019:
    This comment is replaced by the Don't relay conflicted or already confirmed transactions comment above the call to GetDepthInMainChain().
  5. promag commented at 2:19 pm on April 3, 2019: member
    utACK afb608b, since the refactor improves code comments and avoids nesting code.
  6. DrahtBot commented at 2:23 pm on April 3, 2019: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    No conflicts as of last run.

  7. ryanofsky approved
  8. ryanofsky commented at 2:30 pm on April 3, 2019: member
    utACK afb608b1e92773aba2698b698bcf62011ff7b783. This isn’t a pure refactoring so you may want to point out changes in behavior in the commit description (no longer asserting false if GetBroadcastTransactions if false, no longer printing relay message if p2pEnabled is false).
  9. jnewbery force-pushed on Apr 3, 2019
  10. jnewbery commented at 2:44 pm on April 3, 2019: member

    Commit log and PR description updated.

    This will require rebase since #15632 has been updated. I don’t intend to do that until #15632 is merged to avoid multiple iterations of rebase/review.

  11. in src/interfaces/chain.cpp:344 in 57516ebdfc outdated
    340@@ -347,6 +341,7 @@ class ChainImpl : public Chain
    341     CAmount maxTxFee() override { return ::maxTxFee; }
    342     bool getPruneMode() override { return ::fPruneMode; }
    343     bool p2pEnabled() override { return g_connman != nullptr; }
    344+    bool isReadyToBroadcast() override { return !::fImporting && !::fReindex && !IsInitialBlockDownload(); };
    


    practicalswift commented at 1:02 pm on April 5, 2019:
    Nit: Extra ; at end of line :-)

    jnewbery commented at 2:22 pm on April 5, 2019:
    Thanks @practicalswift. That commit is from #15632, where I’ve now removed the extraneous ;. Do you mind reviewing that PR?
  12. DrahtBot added the label Needs rebase on Apr 9, 2019
  13. ryanofsky approved
  14. ryanofsky commented at 2:52 pm on April 9, 2019: member
    utACK 57516ebdfcd288cb6c255fb0fbc94b7fb1e50af7 (just last commits, not base commits). Only change since last review is updating commit description.
  15. [wallet] Refactor CWalletTx::RelayWalletTransaction()
    This refactors the CWalletTx::RelayWalletTransaction() function to be
    clearer and adds comments. It also makes two minor behavior
    changes:
    
    - no longer assert if fBroadcastTransactions is false. Just return false
    from the function.
    - no longer print the relay message if p2pEnabled is set to false (since
    the transaction is not actually relayed).
    7a9046e48d
  16. jnewbery force-pushed on Apr 10, 2019
  17. jnewbery commented at 1:21 pm on April 10, 2019: member
    rebased
  18. DrahtBot removed the label Needs rebase on Apr 10, 2019
  19. promag commented at 3:31 pm on April 10, 2019: member
    utACK 7a9046e48d0aac35e8e6a3dd315aa98a207bebfe.
  20. ryanofsky approved
  21. ryanofsky commented at 8:33 pm on April 10, 2019: member
    utACK 7a9046e48d0aac35e8e6a3dd315aa98a207bebfe. No changes at all, just rebase after base PR #15632 was merged
  22. meshcollider merged this on Apr 11, 2019
  23. meshcollider closed this on Apr 11, 2019

  24. deadalnix referenced this in commit 4a8e17632c on Jun 6, 2020
  25. vijaydasmp referenced this in commit c9be29bcbb on Oct 16, 2021
  26. vijaydasmp referenced this in commit b2c2b9236e on Oct 16, 2021
  27. vijaydasmp referenced this in commit 6b539f8198 on Dec 5, 2021
  28. vijaydasmp referenced this in commit a2b3ae0baf on Dec 6, 2021
  29. vijaydasmp referenced this in commit 309825f547 on Dec 6, 2021
  30. kittywhiskers referenced this in commit 2cb833f5eb on Dec 8, 2021
  31. kittywhiskers referenced this in commit dba81be04c on Dec 8, 2021
  32. kittywhiskers referenced this in commit f30659c937 on Dec 8, 2021
  33. kittywhiskers referenced this in commit 7d71a5fc35 on Dec 11, 2021
  34. kittywhiskers referenced this in commit 9a02c81709 on Dec 12, 2021
  35. kittywhiskers referenced this in commit ea3fb93bd5 on Dec 12, 2021
  36. kittywhiskers referenced this in commit bde7ab644a on Dec 12, 2021
  37. kittywhiskers referenced this in commit fe6cbda5c0 on Dec 12, 2021
  38. kittywhiskers referenced this in commit ee4f2fc8b4 on Dec 12, 2021
  39. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-26 18:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me