gui: Do not create payment server if -disablewallet option provided #16436

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:20190722-payment-server changing 1 files +17 −23
  1. hebasto commented at 3:31 PM on July 22, 2019: member

    This PR makes early check for the -disablewallet option.

    If -disablewallet=1, objects PaymentServer and WalletController are nor created.

  2. hebasto renamed this:
    Do not create payment server if -disablewallet option provided
    wallet: Do not create payment server if -disablewallet option provided
    on Jul 22, 2019
  3. MarcoFalke renamed this:
    wallet: Do not create payment server if -disablewallet option provided
    gui: Do not create payment server if -disablewallet option provided
    on Jul 22, 2019
  4. MarcoFalke added the label GUI on Jul 22, 2019
  5. DrahtBot commented at 6:37 PM on July 22, 2019: member

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

  6. in src/qt/bitcoin.cpp:215 in 20ef0d5103 outdated
     211 | @@ -211,11 +212,15 @@ BitcoinApplication::~BitcoinApplication()
     212 |      delete window;
     213 |      window = nullptr;
     214 |  #ifdef ENABLE_WALLET
     215 | -    delete paymentServer;
     216 | -    paymentServer = nullptr;
     217 | -    delete m_wallet_controller;
     218 | -    m_wallet_controller = nullptr;
     219 | -#endif
     220 | +    if (paymentServer) {
    


    promag commented at 10:19 AM on July 23, 2019:

    This is not necessary, it is safe to delete nullptr.


    promag commented at 10:29 AM on July 23, 2019:

    Or maybe you want to get rid of these delete as these objects are owned by BitcoinApplication instance.


    hebasto commented at 12:42 PM on July 23, 2019:

    Or maybe you want to get rid of these delete as these objects are owned by BitcoinApplication instance.

    Exactly!

  7. in src/qt/bitcoin.cpp:335 in 20ef0d5103 outdated
     354 |  #ifdef ENABLE_WALLET
     355 | -        window->setWalletController(m_wallet_controller);
     356 | +        if (WalletModel::isWalletEnabled()) {
     357 | +            m_wallet_controller = new WalletController(m_node, platformStyle, optionsModel, this);
     358 | +            window->setWalletController(m_wallet_controller);
     359 | +            if (paymentServer) {
    


    promag commented at 10:24 AM on July 23, 2019:

    This could be assert(paymentServer)?


    hebasto commented at 12:35 PM on July 23, 2019:

    Failing to create a PaymentServer object is not critical, IMO.


    laanwj commented at 3:17 PM on July 29, 2019:

    Also new will never return a nullptr anyway.

  8. promag commented at 10:31 AM on July 23, 2019: member

    Concept ACK, makes sense to not instantiate these objects when -disablewallet.

    It would be nice to remove all ENABLE_WALLET and other similar checks from src/qt/bitcoin.cpp.

    nit, commit could also have prefix.

  9. wallet: Recognize -disablewallet option early 4057b7acb7
  10. hebasto force-pushed on Jul 23, 2019
  11. hebasto commented at 12:48 PM on July 23, 2019: member

    @promag Thank you for your review. Your comments have been addressed.

    It would be nice to remove all ENABLE_WALLET and other similar checks from src/qt/bitcoin.cpp.

    Could you elaborate your suggestion?

  12. fanquake commented at 12:09 AM on July 29, 2019: member

    Concept ACK

  13. jonasschnelli commented at 9:10 AM on July 29, 2019: contributor

    utACK 4057b7acb7125739537078d026ad96bb21708e3c Removes three #ifdefs, probably very tiny ressource reduction when not running with the wallet.

  14. laanwj commented at 3:18 PM on July 29, 2019: member

    ACK 4057b7acb7125739537078d026ad96bb21708e3c

  15. laanwj merged this on Jul 29, 2019
  16. laanwj closed this on Jul 29, 2019

  17. laanwj referenced this in commit 2a7c3bc498 on Jul 29, 2019
  18. hebasto deleted the branch on Jul 31, 2019
  19. deadalnix referenced this in commit 227c1121a7 on Oct 12, 2020
  20. Munkybooty referenced this in commit 41c75aa935 on Nov 16, 2021
  21. Munkybooty referenced this in commit e7c5a372f0 on Nov 18, 2021
  22. Munkybooty referenced this in commit 6c8726cb09 on Nov 24, 2021
  23. Munkybooty referenced this in commit a476bf5d2d on Nov 30, 2021
  24. Munkybooty referenced this in commit d456004677 on Dec 15, 2021
  25. 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: 2026-04-21 18:14 UTC

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