public void Ban(IPAddress address, TimeSpan duration) { Assertion.RequiresNonNull(address, nameof(address)); Assertion.Requires <ArgumentException>(duration.TotalMilliseconds > 0, $"{nameof(duration)} must not be empty"); cache.Set(address.ToString(), string.Empty, duration); }
private static BitcoinCoinProperties GetVergeProperties(string algorithm) { Assertion.Requires <ArgumentException>(!string.IsNullOrEmpty(algorithm), $"{nameof(algorithm)} must not be empty"); switch (algorithm.ToLower()) { case "lyra": return(vergeLyraCoin); case "groestl": return(vergeGroestlCoin); case "x17": return(vergeX17Coin); case "blake": return(vergeBlake2sCoin); default: return(vergeScryptCoin); } }
private static BitcoinCoinProperties GetDigiByteProperties(string algorithm) { Assertion.Requires <ArgumentException>(!string.IsNullOrEmpty(algorithm), $"{nameof(algorithm)} must not be empty"); switch (algorithm.ToLower()) { case "sha256d": case "sha256": return(sha256Coin); case "skein": return(skeinCoin); case "qubit": return(qubitCoin); case "groestl": case "groestl-myriad": return(groestlMyriadCoin); default: return(scryptCoin); } }