Skip to content

Conversation

@jonasschnelli
Copy link
Contributor

Reduced wallet/core coupling.
This would also slowly lay groundwork for a possible new wallet candidate.

  • hides CWalletDB behind CWallet
  • reduces ENABLE_WALLET ifdefs

@jonasschnelli jonasschnelli force-pushed the 2015/04/wallet_init_decoup branch from d018f78 to 4e5c56e Compare April 9, 2015 20:22
src/init.cpp Outdated
Copy link

Choose a reason for hiding this comment

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

Would a !pwalletMain help with a NULL pointer here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's within a if (CWallet::IsDisabled()) else control structure. pwalletMain can't be NULL there. But i assume it won't hurt adding a !pwalletMain

@jonasschnelli jonasschnelli changed the title [Wallet] refactor and optimize init.cpp/CWallet interaction refactor and optimize init.cpp/CWallet interaction Apr 10, 2015
@jgarzik
Copy link
Contributor

jgarzik commented Apr 12, 2015

ditto previous PR - code movement in separate commit

concept ACK

@jonasschnelli
Copy link
Contributor Author

Here the moved code did need some adaption. I was trying to make more smaller commits. This was not possible with the fact that every commit should also passes travis (and result in a proper compilable bitcoind/qt)

@jgarzik
Copy link
Contributor

jgarzik commented Apr 12, 2015

fair enough

@jonasschnelli
Copy link
Contributor Author

Rebased.

I'm not sure if i should include another commit which would then completely decouple the wallet over signaling to allow multiple wallet devices:
jonasschnelli@15ccf47#diff-e74648dfe36ec1841b222ca921ad61c0

With this commit it would be a useful groundwork for ZMQ and a wallet rewriting without breaking the current wallet.

@jonasschnelli jonasschnelli force-pushed the 2015/04/wallet_init_decoup branch from c0b1825 to ddae534 Compare April 30, 2015 12:33
@laanwj laanwj added the Wallet label May 6, 2015
@jonasschnelli jonasschnelli force-pushed the 2015/04/wallet_init_decoup branch from ddae534 to 6bf1347 Compare May 8, 2015 09:32
@jonasschnelli
Copy link
Contributor Author

Rebased.

@jonasschnelli jonasschnelli force-pushed the 2015/04/wallet_init_decoup branch from 2f1adc6 to 72ba404 Compare May 8, 2015 09:54
@jonasschnelli
Copy link
Contributor Author

Added another commit on top.

This would decouple the wallet from the core and would allow to have multiple wallets (validation devices) over signaling.

Together with #5994 it would basically remove (almost) all wallet #ifdefs. The goal is to just have one wallet #ifdef at the point where we register for signals.

IMO this is a massiv step forward of core/wallet separation.

@jonasschnelli jonasschnelli force-pushed the 2015/04/wallet_init_decoup branch from 72ba404 to 1588cf2 Compare May 8, 2015 11:28
@jonasschnelli jonasschnelli force-pushed the 2015/04/wallet_init_decoup branch from 1588cf2 to fb5b746 Compare June 15, 2015 12:28
@jonasschnelli
Copy link
Contributor Author

Rebased

Copy link

Choose a reason for hiding this comment

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

Why are we using .count here and not e.g. GetArg()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This code has been moved 1:1 (better review capabilities).

@jonasschnelli
Copy link
Contributor Author

Travis issue seems to be non-related to this PR (race condition)

Copy link

Choose a reason for hiding this comment

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

Not that it would matter that much, but how about using a static variable, that would allow to use GetWalletFile() without the need to store it into another std::string when using the function, which happens quite a few times.

@jonasschnelli jonasschnelli force-pushed the 2015/04/wallet_init_decoup branch 2 times, most recently from 6b6d677 to fb5b746 Compare June 16, 2015 16:06
@jonasschnelli
Copy link
Contributor Author

Rebased this PR.
This PR is required to support two (or more) wallet implementations. This PR would allow to selective compile-in a potential 2nd wallet code.

@jonasschnelli jonasschnelli force-pushed the 2015/04/wallet_init_decoup branch 5 times, most recently from 0ca5c01 to fb5b746 Compare June 19, 2015 19:36
@jgarzik
Copy link
Contributor

jgarzik commented Sep 15, 2015

ut ACK - this seems a reasonable refactor to merge soonish even considering my comments on bitcoin-dev about refactoring - @jonasschnelli seems like the main person working on improving CoreWallet right now, so downstream developer breakage seems unlikely.

@jonasschnelli
Copy link
Contributor Author

This would be a major step in decoupling the wallet from the core (codebase and not process decoupling). I'm ready to continue, but would like to get some concept ACK because this PR is itself relatively "heavy" and requires rebases all the time because it moves code away from init.cpp where often changes happen.

Copy link

Choose a reason for hiding this comment

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

NIT: Add a newline before this and before the next step?

@dcousens
Copy link
Contributor

concept ACK, will review some point soon

@dcousens
Copy link
Contributor

light utACK, will review again after rebase @jonasschnelli

@sipa
Copy link
Member

sipa commented Nov 28, 2015

Needs rebase.

@laanwj
Copy link
Member

laanwj commented Apr 15, 2016

Is this pull still relevant with recent wallet/init.cpp changes? If so needs rebase, otherwise let's close

@jonasschnelli
Copy link
Contributor Author

Right. Closing. #7691 (merged) did contain most of this changes (a slightly different concept though).

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants