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 _)); }
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); }
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)); }