diff options
author | Karl-Johan Alm <karljohan-alm@garage.co.jp> | 2020-03-02 15:57:25 +0900 |
---|---|---|
committer | Karl-Johan Alm <karljohan-alm@garage.co.jp> | 2020-03-02 17:26:30 +0900 |
commit | dc2d0650fdb69d27fe1b0092555b7841d542a635 (patch) | |
tree | d7d5de77c40f5118148187cbc723205b35bd0b1d /src | |
parent | 54a7ef612a3b69984d521432f8a694a682c76090 (diff) | |
download | bitcoin-dc2d0650fdb69d27fe1b0092555b7841d542a635.tar.xz |
make BlockUntilSyncedToCurrentChain() const
The method checks the chain tip for the best block, and calls SyncWithValidationInterfaceQueue() (a standalone function) if necessary.
Diffstat (limited to 'src')
-rw-r--r-- | src/index/base.cpp | 2 | ||||
-rw-r--r-- | src/index/base.h | 2 | ||||
-rw-r--r-- | src/wallet/wallet.cpp | 2 | ||||
-rw-r--r-- | src/wallet/wallet.h | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/index/base.cpp b/src/index/base.cpp index dcb8e99fc1..3f3b301246 100644 --- a/src/index/base.cpp +++ b/src/index/base.cpp @@ -270,7 +270,7 @@ void BaseIndex::ChainStateFlushed(const CBlockLocator& locator) Commit(); } -bool BaseIndex::BlockUntilSyncedToCurrentChain() +bool BaseIndex::BlockUntilSyncedToCurrentChain() const { AssertLockNotHeld(cs_main); diff --git a/src/index/base.h b/src/index/base.h index d0088d9c9a..fb30aa7a0e 100644 --- a/src/index/base.h +++ b/src/index/base.h @@ -97,7 +97,7 @@ public: /// sync once and only needs to process blocks in the ValidationInterface /// queue. If the index is catching up from far behind, this method does /// not block and immediately returns false. - bool BlockUntilSyncedToCurrentChain(); + bool BlockUntilSyncedToCurrentChain() const; void Interrupt(); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 5a97f62b71..ed7601dbbc 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1150,7 +1150,7 @@ void CWallet::UpdatedBlockTip() } -void CWallet::BlockUntilSyncedToCurrentChain() { +void CWallet::BlockUntilSyncedToCurrentChain() const { AssertLockNotHeld(cs_wallet); // Skip the queue-draining stuff if we know we're caught up with // ::ChainActive().Tip(), otherwise put a callback in the validation interface queue and wait diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 6c1c3040c2..668976a574 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -1112,7 +1112,7 @@ public: * Obviously holding cs_main/cs_wallet when going into this call may cause * deadlock */ - void BlockUntilSyncedToCurrentChain() LOCKS_EXCLUDED(cs_main, cs_wallet); + void BlockUntilSyncedToCurrentChain() const LOCKS_EXCLUDED(cs_main, cs_wallet); /** set a single wallet flag */ void SetWalletFlag(uint64_t flags); |