-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: pull libbitcoin_server code out of wallet code 3/N #5743
Conversation
71292ec
to
3f77c9d
Compare
3f77c9d
to
c234a00
Compare
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 206ff59f54..81ac0b7edb 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -5517,7 +5517,7 @@ bool CWallet::GenerateNewHDChainEncrypted(const SecureString& secureMnemonic, co
bool CWallet::ShutdownRequested()
{
- return chain().shutdownRequested();
+ return HaveChain() && chain().shutdownRequested();
}
void CWallet::UpdateProgress(const std::string& title, int nProgress) |
c234a00
to
a2ca4a1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, light ACK 👍
This pull request has conflicts, please rebase. |
a2ca4a1
to
845d5d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-utACK
…of libbitcoin_server 3/N
ping @PastaPastaPasta |
@@ -855,6 +855,8 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati | |||
bool IsLocked(bool fForMixing = false) const override; | |||
bool Lock(bool fForMixing = false); | |||
|
|||
void UpdateProgress(const std::string& title, int nProgress) override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it'd be nice to use string_view here but I think ShowProgress probably wants a std::string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, ShowProgress indeed uses std::string even in the latest version of bitcoin core:
boost::signals2::signal<void (const std::string &title, int nProgress)> ShowProgress;
The strMsg
that is used in scriptpubkeyman.cpp is also std::string, so, using string_view will add a new allocation here, I will keep it as it is.
src/interfaces/chain.h
Outdated
@@ -135,6 +135,9 @@ class Chain | |||
//! Check if transaction will be final given chain height current time. | |||
virtual bool checkFinalTx(const CTransaction& tx) = 0; | |||
|
|||
//! Check if transaction is locked as the instant tx. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please rework this comment; doesn't make sense
src/wallet/wallet.cpp
Outdated
for (const auto& output : group.m_outputs) { | ||
if (!chain.isInstantSendLockedTx(output.outpoint.hash)) return false; | ||
} | ||
return true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactor to use std::all_of, std::any_of or std::none_of ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's not new code, I just moved a function to a new place. Anyway, I provided a refactoring in an extra commit
845d5d5
to
2e0bd50
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-utACK
…of libbitcoin_server 3/N
…of libbitcoin_server 3/N
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK for merging via merge commit
…global variable in wallet's code
2e0bd50
to
e3d9327
Compare
Issue being fixed or feature implemented
Wallet library should not depends on server code (libbitcoin_server).
Untie this library will help to finish backport bitcoin#15639 and will unblock multiprocess: bitcoin#18677
Prior work:
What was done?
havePruned
from interface instead directfPrune
uiInterface
fShutdown
from scriptpubkeymanllmq::quorumInstantSendManager
/llmq::chainLocksHandler
are wrapper in interfacedeterministicMNManager
from wallet codeHow Has This Been Tested?
Amount of linkage errors is decreased from 196 to 141 if
libbitcoin_server
is excluded during linkage:Breaking Changes
N/A
Checklist: