예제 #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));
        }