/// <summary> /// Checks if the coin equals the mode. /// </summary> /// <returns>The pass.</returns> /// <param name="swap">Swap.</param> /// <param name="mode">Mode.</param> private async Task <bool> CoinPass(SecureString secret, SecureString salt, CoinDto swap, int mode) { Guard.Argument(swap, nameof(swap)).NotNull(); Guard.Argument(mode, nameof(mode)).NotNegative(); var canPass = false; var coin = coinService.DeriveCoin(swap, secret, salt); var status = coinService.VerifyCoin(swap, coin); coin.Hash = coinService.Hash(coin).ToHex(); //TODO.... remove coin.Network = walletService.NetworkAddress(coin).ToHex(); coin.Envelope.RangeProof = walletService.NetworkAddress(coin).ToHex(); if (status.Equals(mode)) { var returnCoin = await Client.AddAsync(coin.FormatCoinToBase64(), RestApiMethod.PostCoin); if (returnCoin.Result != null) { canPass = true; } } return(canPass); }