private bool ChainGetBlock(ScriptEngine engine)
        {
            if (engine.EvaluationStack.Count < 1)
            {
                return(false);
            }
            StackItem x = engine.EvaluationStack.Pop();

            byte[][]     data = x.GetBytesArray();
            List <Block> r    = new List <Block>();

            foreach (byte[] d in data)
            {
                switch (d.Length)
                {
                case sizeof(uint):
                    uint height = BitConverter.ToUInt32(d, 0);
                    if (Blockchain.Default != null)
                    {
                        r.Add(Blockchain.Default.GetBlock(height));
                    }
                    else if (height == 0)
                    {
                        r.Add(Blockchain.GenesisBlock);
                    }
                    else
                    {
                        r.Add(null);
                    }
                    break;

                case 32:
                    UInt256 hash = new UInt256(d);
                    if (Blockchain.Default != null)
                    {
                        r.Add(Blockchain.Default.GetBlock(hash));
                    }
                    else if (hash == Blockchain.GenesisBlock.Hash)
                    {
                        r.Add(Blockchain.GenesisBlock);
                    }
                    else
                    {
                        r.Add(null);
                    }
                    break;

                default:
                    return(false);
                }
            }
            engine.EvaluationStack.Push(new StackItem(r.ToArray()));
            return(true);
        }
        private bool ChainGetTx(ScriptEngine engine)
        {
            if (engine.EvaluationStack.Count < 1)
            {
                return(false);
            }
            StackItem x = engine.EvaluationStack.Pop();

            Transaction[] r = x.GetBytesArray().Select(p => Blockchain.Default?.GetTransaction(new UInt256(p))).ToArray();
            engine.EvaluationStack.Push(new StackItem(r));
            return(true);
        }