Skip to content

util, refactor: Improve headers for bitcoin-wallet tool - #23346

Merged
maflcko merged 1 commit into
bitcoin:masterfrom
hebasto:211024-bw-headers
Dec 9, 2021
Merged

maflcko merged 1 commit into
bitcoin:masterfrom
hebasto:211024-bw-headers

Conversation

@hebasto

@hebasto hebasto commented Oct 24, 2021 •

Copy link
Copy Markdown
Member

This PR:

  • removes unneeded #include <wallet/wallet.h> from <wallet/wallettool.h>
  • introduces class forward declaration in <wallet/wallettool.h>
  • added #include <config/bitcoin-config.h> to wallet/wallettool.cpp where the USE_BDB macro is used

@DrahtBot

DrahtBot commented Oct 24, 2021 •

Copy link
Copy Markdown
Contributor

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

Conflicts

No conflicts as of last run.

@hebasto

hebasto commented Oct 26, 2021

Copy link
Copy Markdown
Member Author

Rebased 5fc7c31 -> 49b906c (pr23346.01 -> pr23346.02) due to the conflict with #23006.

@stratospher stratospher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 49b906c. Verified that:

  • #include <wallet/wallet.h> isn’t needed in src/wallet/wallettool.h
  • All the newly added #include in the files are necessary.

I’m curious to know why WalletShowInfo() was moved out of src/wallet/wallettool.h though.

@hebasto

hebasto commented Oct 27, 2021

Copy link
Copy Markdown
Member Author

I’m curious to know why WalletShowInfo() was moved out of src/wallet/wallettool.h though.

It is used in the only compilation unit:

static void WalletShowInfo(CWallet* wallet_instance)

Comment thread src/bitcoin-wallet.cpp
Comment on lines -5 to -8
#if defined(HAVE_CONFIG_H)
#include <config/bitcoin-config.h>
#endif

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be left in IMO.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hebasto

hebasto commented Oct 30, 2021

Copy link
Copy Markdown
Member Author

Updated 49b906c -> 3431839 (pr23346.02 -> pr23346.03, diff):

@Sjors

Sjors commented Dec 9, 2021

Copy link
Copy Markdown
Member

Lgtm, @achow101?

@maflcko
maflcko merged commit 7ce8d74 into bitcoin:master Dec 9, 2021
Comment thread src/wallet/wallettool.cpp
#include <config/bitcoin-config.h>
#endif

#include <wallet/wallettool.h>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't matter here, but the self-include is always the very first one on its own section for us, I think

@hebasto
hebasto deleted the 211024-bw-headers branch December 9, 2021 13:17
RandyMcMillan pushed a commit to RandyMcMillan/mempool-tab that referenced this pull request Dec 23, 2021
…oin-wallet tool

d99b3a7 util, refactor: Improve headers for bitcoin-wallet tool (Hennadii Stepanov)

Pull request description:

  This PR:
  - removes unneeded `#include <wallet/wallet.h>` from `<wallet/wallettool.h>`
  - introduces class forward declaration in `<wallet/wallettool.h>`
  - added `#include <config/bitcoin-config.h>` to `wallet/wallettool.cpp` where the `USE_BDB` macro is used

Top commit has no ACKs.

Tree-SHA512: a0de560d821f8b570ae806a1165b9b382c9e0b339687d932052fa4c38ab2ba493e7e050f19adc02ad7db40c42cf88ac1d37209f9071494a0ab268ed33ff22b9f
@bitcoin bitcoin locked and limited conversation to collaborators Dec 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants