func (b *BlockChain) warnUnknownVersions(node *blockNode) {
	// Nothing to do if already warned.
	if b.unknownVersionsWarned {
		return
	}

	// Warn if enough previous blocks have unexpected versions.
	numUpgraded := uint32(0)
	for i := uint32(0); i < unknownVerNumToCheck && node != nil; i++ {
		expectedVersion := b.calcNextBlockVersion(node.parent)
		if expectedVersion > vbLegacyBlockVersion &&
			(node.version & ^expectedVersion) != 0 {

			numUpgraded++
		}

		node = node.parent
	}
	if numUpgraded > unknownVerWarnNum {
		log.Warn("Unknown block versions are being mined, so new " +
			"rules might be in effect.  Are you running the " +
			"latest version of the software?")
		b.unknownVersionsWarned = true
	}

	return
}
// warnUnknownVersions logs a warning if a high enough percentage of the last
// blocks have unexpected versions.
//
// This function MUST be called with the chain state lock held (for writes)
warnUnknownVersions logs a warning if a high enough percentage of the last
blocks have unexpected versions.

This function MUST be called with the chain state lock held (for writes)
// warnUnknownVersions logs a warning if a high enough percentage of the last // blocks have unexpected versions . // // This function MUST be called with the chain state lock held ( for writes )
func (b *BlockChain) warnUnknownVersions(node *blockNode) {
	if b.unknownVersionsWarned {
		return
	}
	numUpgraded := uint32(0)
	for i := uint32(0); i < unknownVerNumToCheck && node != nil; i++ {
		expectedVersion := b.calcNextBlockVersion(node.parent)
		if expectedVersion > vbLegacyBlockVersion &&
			(node.version & ^expectedVersion) != 0 {
			numUpgraded++
		}
		node = node.parent
	}
	if numUpgraded > unknownVerWarnNum {
		log.Warn("Unknown block versions are being mined, so new " +
			"rules might be in effect.  Are you running the " +
			"latest version of the software?")
		b.unknownVersionsWarned = true
	}
	return
}
func ( b * BlockChain ) warnUnknownVersions ( node * blockNode ) { if b . unknownVersionsWarned { return } numUpgraded := uint32 ( 0 ) for i := uint32 ( 0 ) ; i < unknownVerNumToCheck && node != nil ; i ++ { expectedVersion := b . calcNextBlockVersion ( node . parent ) if expectedVersion > vbLegacyBlockVersion && ( node . version & ^ expectedVersion ) != 0 { numUpgraded ++ } node = node . parent } if numUpgraded > unknownVerWarnNum { log . Warn ( " " + " " + " " ) b . unknownVersionsWarned = true } return }
warnUnknownVersions logs a warning if a high enough percentage of the last
blocks have unexpected versions.
warnUnknownVersions logs a warning if a high enough percentage of the last blocks have unexpected versions .
// Nothing to do if already warned. // Warn if enough previous blocks have unexpected versions.