void bitc_ios_dashboard_update(void) { btc_block_header hdr; char hashStr[80]; char *ts = NULL; uint256 hash; int height; bool s; if (btc->blockStore == NULL) { return; } height = blockstore_get_height(btc->blockStore); if (height == 0) { return; } s = blockstore_get_block_at_height(btc->blockStore, height, &hash, &hdr); ASSERT(mutex_islocked(btcui->lock)); uint256_snprintf_reverse(hashStr, sizeof hashStr, &hash); ts = print_time_local(hdr.timestamp, "%c"); DashboardUpdate(height, hashStr, btcui->num_peers_active, btcui->num_peers_alive, btcui->num_addrs, ts ? ts : ""); free(ts); }
void condvar_wait(struct condvar *cv, struct mutex *lock) { ASSERT(mutex_islocked(lock)); pthread_cond_wait(&cv->condvar, &lock->lck); }
void bitc_ios_blocklist_update(void) { int height; ASSERT(mutex_islocked(btcui->lock)); height = blockstore_get_height(btc->blockStore); BlockListAddBlock(height); }