Beispiel #1
0
        public JObject Mempool(NetworkRequest request)
        {
            NeoTransaction[]        neoTxes = Blockchain.Singleton.MemPool.ToArray();
            TransactionIdentifier[] transactionIdentifiers = neoTxes.Select(p => new TransactionIdentifier(p.Hash.ToString())).ToArray();
            MempoolResponse         response = new MempoolResponse(transactionIdentifiers);

            return(response.ToJson());
        }
Beispiel #2
0
        /// <summary>
        /// Get all Transaction Identifiers in the mempool
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public JObject Mempool(NetworkRequest request)
        {
            if (request.NetworkIdentifier?.Blockchain?.ToLower() != "neo n3")
            {
                return(Error.NETWORK_IDENTIFIER_INVALID.ToJson());
            }
            if (request.NetworkIdentifier?.Network?.ToLower() != network)
            {
                return(Error.NETWORK_IDENTIFIER_INVALID.ToJson());
            }
            NeoTransaction[]        neoTxes = system.MemPool.ToArray();
            TransactionIdentifier[] transactionIdentifiers = neoTxes.Select(p => new TransactionIdentifier(p.Hash.ToString())).ToArray();
            MempoolResponse         response = new MempoolResponse(transactionIdentifiers);

            return(response.ToJson());
        }