src/BlockChain/Validators/BlockValidator.cpp
// check we have no kernels with lock_heights greater than current height
// no tx can be included in a block earlier than its lock_height
check we have no kernels with lock_heights greater than current height
no tx can be included in a block earlier than its lock_height
check we have no kernels with lock_heights greater than current height no tx can be included in a block earlier than its lock_height
void BlockValidator::VerifyKernelLockHeights(const FullBlock& block) const
{
	const uint64_t blockHeight = block.GetHeight();
	const std::vector<TransactionKernel>& kernels = block.GetKernels();
	const bool invalid = std::any_of(
		kernels.cbegin(),
		kernels.cend(),
		[blockHeight](const TransactionKernel& kernel) { return kernel.GetLockHeight() > blockHeight; }
	);
	if (invalid)
	{
		LOG_ERROR_F("Failed to validate kernel lock heights for {}", block);
		throw BAD_DATA_EXCEPTION("Failed to validate kernel lock heights");
	}
}
void BlockValidator :: VerifyKernelLockHeights ( const FullBlock & block ) const { const uint64_t blockHeight = block . GetHeight ( ) ; const std :: vector < TransactionKernel > & kernels = block . GetKernels ( ) ; const bool invalid = std :: any_of ( kernels . cbegin ( ) , kernels . cend ( ) , [ blockHeight ] ( const TransactionKernel & kernel ) { return kernel . GetLockHeight ( ) > blockHeight ; } ) ; if ( invalid ) { LOG_ERROR_F ( " " , block ) ; throw BAD_DATA_EXCEPTION ( " " ) ; } }
check we have no kernels with lock_heights greater than current height
no tx can be included in a block earlier than its lock_height
check we have no kernels with lock_heights greater than current height no tx can be included in a block earlier than its lock_height