interfaces: Describe and follow some code conventions #18278

pull ryanofsky wants to merge 6 commits into bitcoin:master from ryanofsky:pr/ipc-conv changing 17 files +208 −93
  1. ryanofsky commented at 2:34 PM on March 6, 2020: contributor

    This PR is part of the process separation project.

    This PR doesn't change behavior at all, it just cleans up code in src/interfaces to simplify #10102, and documents coding conventions there better

  2. fanquake added the label Refactoring on Mar 6, 2020
  3. hebasto commented at 3:07 PM on March 6, 2020: member

    Concept ACK.

  4. ryanofsky force-pushed on Mar 6, 2020
  5. ryanofsky force-pushed on Mar 6, 2020
  6. practicalswift commented at 3:55 PM on March 6, 2020: contributor

    Concept ACK

    On behalf of the eternal stream of future generations of Bitcoin Core developers: thank you for cleaning up the code base :)

  7. promag commented at 4:24 PM on March 6, 2020: member

    Code review ACK 2427e93f5823cffcf1158d1cd389b9d2ef703521.

  8. DrahtBot commented at 4:45 PM on March 6, 2020: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #18351 (Updated text on send confirmation dialog by dannmat)
    • #18338 (Fix wallet unload race condition by promag)
    • #18239 (wip: gui: Refactor to drop client and wallet models setters by promag)
    • #17954 (wallet: Remove calls to Chain::Lock methods by ryanofsky)
    • #17877 (qt, refactor: Make enums in BitcoinUnits class scoped by hebasto)
    • #17543 (wallet: undo conflicts properly in case of blocks disconnection by ariard)
    • #17509 (gui: save and load PSBT by Sjors)
    • #17463 (Bugfix: GUI: Restore SendConfirmationDialog button default to "Yes" by luke-jr)
    • #16528 (Native Descriptor Wallets using DescriptorScriptPubKeyMan by achow101)
    • #16432 (qt: Add privacy to the Overview page by hebasto)
    • #14942 (wallet: Make scan / abort status private to CWallet by Empact)
    • #9381 (Remove CWalletTx merging logic from AddToWallet by ryanofsky)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  9. DrahtBot cross-referenced this on Mar 6, 2020 from issue wallet/refactor: refer to CWallet immutably when possible by kallewoof
  10. DrahtBot cross-referenced this on Mar 6, 2020 from issue wip: gui: Refactor to drop client and wallet models setters by promag
  11. DrahtBot cross-referenced this on Mar 6, 2020 from issue wallet: Remove calls to Chain::Lock methods by ryanofsky
  12. DrahtBot cross-referenced this on Mar 6, 2020 from issue qt, refactor: Make BitcoinUnits::Unit a scoped enum by hebasto
  13. DrahtBot cross-referenced this on Mar 6, 2020 from issue wallet: undo conflicts properly in case of blocks disconnection by ariard
  14. DrahtBot cross-referenced this on Mar 6, 2020 from issue gui: save and load PSBT by Sjors
  15. DrahtBot cross-referenced this on Mar 6, 2020 from issue Remove the mempool's NotifyEntryAdded and NotifyEntryRemoved signals by jnewbery
  16. DrahtBot cross-referenced this on Mar 6, 2020 from issue Bugfix: GUI: Restore SendConfirmationDialog button default to "Yes" by luke-jr
  17. DrahtBot cross-referenced this on Mar 6, 2020 from issue Drop checkFinalTx and use Median Time Past to check finality of wallet transactions by ariard
  18. DrahtBot cross-referenced this on Mar 6, 2020 from issue UI external signer support (e.g. hardware wallet) by Sjors
  19. DrahtBot cross-referenced this on Mar 6, 2020 from issue External signer support - Wallet Box edition by Sjors
  20. DrahtBot cross-referenced this on Mar 6, 2020 from issue Native Descriptor Wallets using DescriptorScriptPubKeyMan by achow101
  21. DrahtBot cross-referenced this on Mar 6, 2020 from issue qt: Add privacy to the Overview page by hebasto
  22. DrahtBot cross-referenced this on Mar 6, 2020 from issue wallet: Make scan / abort status private to CWallet by Empact
  23. DrahtBot cross-referenced this on Mar 6, 2020 from issue Remove CWalletTx merging logic from AddToWallet by ryanofsky
  24. ryanofsky added this to the "In progress" column in a project

  25. ryanofsky force-pushed on Mar 6, 2020
  26. ryanofsky commented at 11:44 PM on March 6, 2020: contributor

    Rebased 2427e93f5823cffcf1158d1cd389b9d2ef703521 -> 60ae4c0756ed14eed31a13c3813e9714cab060d0 (pr/ipc-conv.3 -> pr/ipc-conv.4, compare) due to conflict with #18241

  27. ryanofsky cross-referenced this on Mar 6, 2020 from issue Multiprocess bitcoin by ryanofsky
  28. in src/interfaces/chain.h:160 in 5212bd926b outdated
     153 | @@ -154,7 +154,10 @@ class Chain
     154 |      //! Transaction is added to memory pool, if the transaction fee is below the
     155 |      //! amount specified by max_tx_fee, and broadcast to all peers if relay is set to true.
     156 |      //! Return false if the transaction could not be added due to the fee or for another reason.
     157 | -    virtual bool broadcastTransaction(const CTransactionRef& tx, std::string& err_string, const CAmount& max_tx_fee, bool relay) = 0;
     158 | +    virtual bool broadcastTransaction(const CTransactionRef& tx,
     159 | +        const CAmount& max_tx_fee,
     160 | +        bool relay,
     161 | +        std::string& err_string) = 0;
    


    hebasto commented at 10:00 PM on March 7, 2020:

    nit: is this needed to break the line here while keeping this function definition one-liner in chain.cpp?


    ryanofsky commented at 7:14 PM on March 9, 2020:

    re: #18278 (review)

    nit: is this needed to break the line here while keeping this function definition one-liner in chain.cpp?

    added same wrapping

  29. in src/interfaces/node.h:207 in c7b9338fd3 outdated
     203 | @@ -204,7 +204,7 @@ class Node
     204 |      virtual std::unique_ptr<Wallet> loadWallet(const std::string& name, std::string& error, std::vector<std::string>& warnings) = 0;
     205 |  
     206 |      //! Create a wallet from file
     207 | -    virtual WalletCreationStatus createWallet(const SecureString& passphrase, uint64_t wallet_creation_flags, const std::string& name, std::string& error, std::vector<std::string>& warnings, std::unique_ptr<Wallet>& result) = 0;
     208 | +    virtual std::unique_ptr<Wallet> createWallet(const SecureString& passphrase, uint64_t wallet_creation_flags, const std::string& name, std::string& error, std::vector<std::string>& warnings, WalletCreationStatus& status) = 0;
    


    hebasto commented at 10:15 PM on March 7, 2020:

    nit: considering a new signature of the refactored function could a more appropriate semantically name be chosen? newWallet or smth similar?


    ryanofsky commented at 7:14 PM on March 9, 2020:

    re: #18278 (review)

    nit: considering a new signature of the refactored function could a more appropriate semantically name be chosen? newWallet or smth similar?

    Unclear why that name is more semantically appropriate, but not knowing this, it seems reasonable for the interface wrapper method name to have the same name as the function it is wrapping

  30. hebasto approved
  31. hebasto commented at 10:27 PM on March 7, 2020: member

    ACK 60ae4c0756ed14eed31a13c3813e9714cab060d0.

    It seems AppVeyor fail is unrelated to this PR changes.

  32. ryanofsky force-pushed on Mar 9, 2020
  33. ryanofsky commented at 7:25 PM on March 9, 2020: contributor

    Thanks for review

    Updated 60ae4c0756ed14eed31a13c3813e9714cab060d0 -> 43c3b391feeb0ad1b2faa4e269b64175399ef5df (pr/ipc-conv.4 -> pr/ipc-conv.5, compare) adding suggested wrapping

  34. DrahtBot added the label Needs rebase on Mar 9, 2020
  35. ryanofsky force-pushed on Mar 9, 2020
  36. ryanofsky commented at 9:31 PM on March 9, 2020: contributor

    Rebased 43c3b391feeb0ad1b2faa4e269b64175399ef5df -> 25f1a842929dd73bcec26c5ce213adfc65b9cb2e (pr/ipc-conv.5 -> pr/ipc-conv.6, compare) due to confilct with #18115

  37. DrahtBot removed the label Needs rebase on Mar 9, 2020
  38. hebasto approved
  39. hebasto commented at 9:14 AM on March 11, 2020: member

    re-ACK 25f1a842929dd73bcec26c5ce213adfc65b9cb2e

  40. DrahtBot cross-referenced this on Mar 13, 2020 from issue Fix wallet unload race condition by promag
  41. DrahtBot cross-referenced this on Mar 14, 2020 from issue Updated text on send confirmation dialog by dannmat
  42. DrahtBot added the label Needs rebase on Mar 19, 2020
  43. refactor: Get rid of Wallet::IsWalletFlagSet method
    Replace by privateKeysDisabled method to avoid need for GUI to reference
    internal wallet flags.
    
    Also remove adjacent WalletModel canGetAddresses wrapper that serves no purpose
    and make Wallet::canGetAddresses non-const so it can be implemented by IPC
    classes in #10102.
    77e4b06572
  44. refactor: Rename Node::disconnect methods
    Avoid overloading method name to work more easily with IPC framework
    1c2ab1a6d2
  45. refactor: Rename Chain::Notifications methods to be consistent with other interfaces methods
    This also simplifies #10102 removing overrides needed to deal with inconsistent
    case convention
    6ceb21909c
  46. refactor: Change Chain::broadcastTransaction param order
    Make output argument last argument so it works more easily with IPC framework
    in #10102, and for consistency with other methods
    96dfe5ced6
  47. refactor: Change createWallet, fillPSBT argument order
    Move output arguments after input arguments for consistency with other methods,
    and to work more easily with IPC framework in #10102
    1dca9dc4c7
  48. doc: Add internal interface conventions to developer notes 3dc27a1524
  49. ryanofsky force-pushed on Mar 20, 2020
  50. ryanofsky commented at 1:30 PM on March 20, 2020: contributor

    Rebased 25f1a842929dd73bcec26c5ce213adfc65b9cb2e -> 3dc27a15242a22b5301904375e5880372e9b7f4d (pr/ipc-conv.6 -> pr/ipc-conv.7, compare) due to conflict with #17477

  51. DrahtBot removed the label Needs rebase on Mar 20, 2020
  52. hebasto commented at 6:52 PM on March 23, 2020: member

    re-ACK 3dc27a15242a22b5301904375e5880372e9b7f4d, the only change since the previous review is rebasing.

  53. MarcoFalke commented at 8:37 PM on March 23, 2020: member

    ACK 3dc27a15242a22b5301904375e5880372e9b7f4d 🕍

    <details><summary>Show signature and timestamp</summary>

    Signature:

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    ACK 3dc27a15242a22b5301904375e5880372e9b7f4d 🕍
    -----BEGIN PGP SIGNATURE-----
    
    iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
    pUgv6Qv+N5ucWCeIaDagqqWUUjRwyJrTq8kr9yZWzQIsZ9zBbrnaxsr106m6Gc8T
    NEmKSbDdgLK+oXFFDRYmO7kvVib0hUoVcfZfq42vSEfqg5mMBKUG6DFAGseKh0Fg
    LdsvKuczDSeb/L52uIrdQe/ptzpjCqJvHHiScn7SoOidAiyjFWwdhOtBwV7oRuF9
    UgGD10K5O7hy70rmn9JOG7GPI1T5NYG2ZgAy7w2n2ChBNeNv9mSse/pDKOgrbhS8
    97Fsl5P+SQq2Fi3aQDLBRd5/sj2nu0BpoKCoowJsRHE4GOeAngdZI6f1EOpYLamH
    s91MQOTXMgN3VFvhnKSNSVesNmMbvGs4aCyLSXQvPh4ni7jpwjpPf7czl3IItn0L
    KnrgUg7uVquxU2FXOvRaVmKo1/PvicrhWYp2Vh8QN06yi91ALoqUqiWHBkdKiwN6
    KoAfUKas0Xn+xgg4h+RKNYh5SFLjNEzResi9+ED5KfDW+sjFR9vzElOHiEf/u+Lb
    F661+ybw
    =ipNG
    -----END PGP SIGNATURE-----
    

    Timestamp of file with hash a78b9d76a84ed28d935046f7fd167bda964ff54cc7339f5435a9c7c3e22c90ed -

    </details>

  54. MarcoFalke merged this on Mar 23, 2020
  55. MarcoFalke closed this on Mar 23, 2020

  56. sidhujag referenced this in commit d630e78524 on Mar 28, 2020
  57. MarkLTZ cross-referenced this on Apr 4, 2020 from issue Bitcoin PR tracking by MarkLTZ
  58. ryanofsky moved this from the "In progress" to the "Done" column in a project

  59. jasonbcox referenced this in commit b4ad0581f6 on Oct 21, 2020
  60. jasonbcox referenced this in commit 4f3e6494f3 on Oct 21, 2020
  61. jasonbcox referenced this in commit a44de4c634 on Oct 21, 2020
  62. deadalnix referenced this in commit ba43817291 on Oct 21, 2020
  63. jasonbcox referenced this in commit 24128015c5 on Oct 21, 2020
  64. jasonbcox referenced this in commit 1f00ddc620 on Oct 21, 2020
  65. bitcoin locked this on Feb 15, 2022

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: 2026-05-20 06:54 UTC