示例#1
0
        public bool TryRemove(TransactionReceipt receipt)
        {
            var nonce = receipt.Transaction.Nonce;
            var from  = receipt.Transaction.From;
            var key   = new AddressWithNonce(from, nonce);

            return(_hashPerAddressWithNonce.TryRemove(key, out var _));
        }
示例#2
0
        public bool TryGetTransactionHash(UInt160 address, ulong nonce, out UInt256?hash)
        {
            hash = null;
            var key = new AddressWithNonce(address, nonce);

            if (_hashPerAddressWithNonce.TryGetValue(key, out var txHash))
            {
                hash = txHash;
                return(true);
            }
            return(false);
        }
示例#3
0
        public bool TryAdd(TransactionReceipt receipt)
        {
            var hash  = receipt.Hash;
            var nonce = receipt.Transaction.Nonce;
            var from  = receipt.Transaction.From;
            var key   = new AddressWithNonce(from, nonce);

            if (_hashPerAddressWithNonce.ContainsKey(key))
            {
                return(false);
            }
            return(_hashPerAddressWithNonce.TryAdd(key, hash));
        }