Show / Hide Table of Contents

Blockchain.GetHeight Method ()

Returns the current block height of the blockchain. Block height = block index = number of blocks - 1.

Namespace: Neo.SmartContract.Framework.Services.Neo

Assembly: Neo.SmartContract.Framework

Syntax

public static extern uint GetHeight()

Return Value: Block height as an unsigned integer.

Example

public class Contract1: SmartContract
{
     public static void Main ()
     {
         Uint height = Blockchain.GetHeight();
     }
}

Back