Ledger.GetBlock Method
Gets block by the block hash or index.
Namespace:Neo.SmartContract.Framework.Native
Assembly: Neo.SmartContract.Framework
#
Syntaxpublic static extern Block GetBlock(uint index);public static extern Block GetBlock(UInt256 hash);
Parameters:
- index: Index of the block to query
- hash: Hash of the block to query
#
Examplepublic class Contract1 : SmartContract.Framework.SmartContract{ public static void Test() { var block = Ledger.GetBlock(100); } public static void Test2(UInt256 hash) { var block = Ledger.GetBlock(hash); }}