| 1279 | |
| 1280 | |
| 1281 | void 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 | |
| 1306 | isminetype CWallet::IsMine(const CTxIn &txin) const |
no test coverage detected