func (pool *FridayBlockPool) IsCaughtUp() bool {
	pool.mtx.Lock()
	defer pool.mtx.Unlock()

	// Need at least 1 peer to be considered caught up.
	if len(pool.peers) == 0 {
		pool.Logger.Debug("Blockpool has no peers")
		return false
	}

	// Some conditions to determine if we're caught up.
	// Ensures we've either received a block or waited some amount of time,
	// and that we're synced to the highest known height.
	// Note we use maxPeerHeight - ulb because to sync block H requires block H+ulb
	// to verify the LastCommit.
	receivedBlockOrTimedOut := pool.height > 0 || time.Since(pool.startTime) > 5*time.Second
	ourChainIsLongestAmongPeers := pool.maxPeerHeight == 0 || pool.height >= (pool.maxPeerHeight-pool.ulbHandler())
	isCaughtUp := receivedBlockOrTimedOut && ourChainIsLongestAmongPeers
	return isCaughtUp
}
// IsCaughtUp returns true if this node is caught up, false - otherwise.
// TODO: relax conditions, prevent abuse.
// NOTE: fix check pool height condition for ulb
IsCaughtUp returns true if this node is caught up, false - otherwise.
TODO: relax conditions, prevent abuse.
NOTE: fix check pool height condition for ulb
// IsCaughtUp returns true if this node is caught up false - otherwise . // TODO : relax conditions prevent abuse . // NOTE : fix check pool height condition for ulb
func (pool *FridayBlockPool) IsCaughtUp() bool {
	pool.mtx.Lock()
	defer pool.mtx.Unlock()
	if len(pool.peers) == 0 {
		pool.Logger.Debug("Blockpool has no peers")
		return false
	}
	receivedBlockOrTimedOut := pool.height > 0 || time.Since(pool.startTime) > 5*time.Second
	ourChainIsLongestAmongPeers := pool.maxPeerHeight == 0 || pool.height >= (pool.maxPeerHeight-pool.ulbHandler())
	isCaughtUp := receivedBlockOrTimedOut && ourChainIsLongestAmongPeers
	return isCaughtUp
}
func ( pool * FridayBlockPool ) IsCaughtUp ( ) bool { pool . mtx . Lock ( ) defer pool . mtx . Unlock ( ) if len ( pool . peers ) == 0 { pool . Logger . Debug ( " " ) return false } receivedBlockOrTimedOut := pool . height > 0 || time . Since ( pool . startTime ) > 5 * time . Second ourChainIsLongestAmongPeers := pool . maxPeerHeight == 0 || pool . height >= ( pool . maxPeerHeight - pool . ulbHandler ( ) ) isCaughtUp := receivedBlockOrTimedOut && ourChainIsLongestAmongPeers return isCaughtUp }
IsCaughtUp returns true if this node is caught up, false - otherwise.
IsCaughtUp returns true if this node is caught up false - otherwise .
// Need at least 1 peer to be considered caught up. // Some conditions to determine if we're caught up. // Ensures we've either received a block or waited some amount of time, // and that we're synced to the highest known height. // Note we use maxPeerHeight - ulb because to sync block H requires block H+ulb // to verify the LastCommit.