Skip to content

Commit dc2d065

Browse files
committed
make BlockUntilSyncedToCurrentChain() const
The method checks the chain tip for the best block, and calls SyncWithValidationInterfaceQueue() (a standalone function) if necessary.
1 parent 54a7ef6 commit dc2d065

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/index/base.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ void BaseIndex::ChainStateFlushed(const CBlockLocator& locator)
270270
Commit();
271271
}
272272

273-
bool BaseIndex::BlockUntilSyncedToCurrentChain()
273+
bool BaseIndex::BlockUntilSyncedToCurrentChain() const
274274
{
275275
AssertLockNotHeld(cs_main);
276276

src/index/base.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class BaseIndex : public CValidationInterface
9797
/// sync once and only needs to process blocks in the ValidationInterface
9898
/// queue. If the index is catching up from far behind, this method does
9999
/// not block and immediately returns false.
100-
bool BlockUntilSyncedToCurrentChain();
100+
bool BlockUntilSyncedToCurrentChain() const;
101101

102102
void Interrupt();
103103

src/wallet/wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ void CWallet::UpdatedBlockTip()
11501150
}
11511151

11521152

1153-
void CWallet::BlockUntilSyncedToCurrentChain() {
1153+
void CWallet::BlockUntilSyncedToCurrentChain() const {
11541154
AssertLockNotHeld(cs_wallet);
11551155
// Skip the queue-draining stuff if we know we're caught up with
11561156
// ::ChainActive().Tip(), otherwise put a callback in the validation interface queue and wait

src/wallet/wallet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ class CWallet final : public WalletStorage, private interfaces::Chain::Notificat
11121112
* Obviously holding cs_main/cs_wallet when going into this call may cause
11131113
* deadlock
11141114
*/
1115-
void BlockUntilSyncedToCurrentChain() LOCKS_EXCLUDED(cs_main, cs_wallet);
1115+
void BlockUntilSyncedToCurrentChain() const LOCKS_EXCLUDED(cs_main, cs_wallet);
11161116

11171117
/** set a single wallet flag */
11181118
void SetWalletFlag(uint64_t flags);

0 commit comments

Comments
 (0)