MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / BlockUntilSyncedToCurrentChain

Method BlockUntilSyncedToCurrentChain

src/wallet/wallet.cpp:1281–1303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1279
1280
1281void CWallet::BlockUntilSyncedToCurrentChain() {
1282 AssertLockNotHeld(cs_main);
1283 AssertLockNotHeld(cs_wallet);
1284
1285 {
1286 // Skip the queue-draining stuff if we know we're caught up with
1287 // chainActive.Tip()...
1288 // We could also take cs_wallet here, and call m_last_block_processed
1289 // protected by cs_wallet instead of cs_main, but as long as we need
1290 // cs_main here anyway, it's easier to just call it cs_main-protected.
1291 LOCK(cs_main);
1292 const CBlockIndex* initialChainTip = chainActive.Tip();
1293
1294 if (m_last_block_processed && m_last_block_processed->GetAncestor(initialChainTip->nHeight) == initialChainTip) {
1295 return;
1296 }
1297 }
1298
1299 // ...otherwise put a callback in the validation interface queue and wait
1300 // for the queue to drain enough to execute it (indicating we are caught up
1301 // at least with the time we entered this function).
1302 SyncWithValidationInterfaceQueue();
1303}
1304
1305
1306isminetype CWallet::IsMine(const CTxIn &txin) const

Callers 15

sendtoaddressFunction · 0.45
listaddressgroupingsFunction · 0.45
getreceivedbyaddressFunction · 0.45
getreceivedbylabelFunction · 0.45
getbalanceFunction · 0.45
getunconfirmedbalanceFunction · 0.45
sendfromFunction · 0.45
sendmanyFunction · 0.45
listreceivedbyaddressFunction · 0.45
listreceivedbylabelFunction · 0.45
listtransactionsFunction · 0.45
listaccountsFunction · 0.45

Calls 3

GetAncestorMethod · 0.80
TipMethod · 0.45

Tested by

no test coverage detected