From 3921a3ca2242f4011f3794fd79dba63785eab1a0 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Fri, 26 Oct 2018 18:36:58 +0900 Subject: [PATCH] Fix warnings, update libs --- BTCPayServer.Tests/BTCPayServer.Tests.csproj | 2 +- BTCPayServer/BTCPayServer.csproj | 4 ++-- BTCPayServer/Controllers/StoresController.Changelly.cs | 2 -- BTCPayServer/Controllers/WalletsController.cs | 4 +--- BTCPayServer/Payments/Changelly/Changelly.cs | 5 +++-- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/BTCPayServer.Tests/BTCPayServer.Tests.csproj b/BTCPayServer.Tests/BTCPayServer.Tests.csproj index 3104ec79b..b670110e1 100644 --- a/BTCPayServer.Tests/BTCPayServer.Tests.csproj +++ b/BTCPayServer.Tests/BTCPayServer.Tests.csproj @@ -9,7 +9,7 @@ - + all diff --git a/BTCPayServer/BTCPayServer.csproj b/BTCPayServer/BTCPayServer.csproj index 3cc8fdc53..1a5ef05b1 100644 --- a/BTCPayServer/BTCPayServer.csproj +++ b/BTCPayServer/BTCPayServer.csproj @@ -44,10 +44,10 @@ - + - + diff --git a/BTCPayServer/Controllers/StoresController.Changelly.cs b/BTCPayServer/Controllers/StoresController.Changelly.cs index 0a434f6f3..16f113680 100644 --- a/BTCPayServer/Controllers/StoresController.Changelly.cs +++ b/BTCPayServer/Controllers/StoresController.Changelly.cs @@ -88,8 +88,6 @@ namespace BTCPayServer.Controllers vm.StatusMessage = $"Error: {ex.Message}"; return View(vm); } - - break; default: return View(vm); } diff --git a/BTCPayServer/Controllers/WalletsController.cs b/BTCPayServer/Controllers/WalletsController.cs index b9e75c8fc..f03e0dab1 100644 --- a/BTCPayServer/Controllers/WalletsController.cs +++ b/BTCPayServer/Controllers/WalletsController.cs @@ -367,9 +367,8 @@ namespace BTCPayServer.Controllers throw new HardwareWalletException($"This store is not configured to use this ledger"); } - TransactionBuilder builder = new TransactionBuilder(); + TransactionBuilder builder = network.NBitcoinNetwork.CreateTransactionBuilder(); builder.StandardTransactionPolicy.MinRelayTxFee = summary.Status.BitcoinStatus.MinRelayTxFee; - builder.SetConsensusFactory(network.NBitcoinNetwork); builder.AddCoins(unspentCoins.Select(c => c.Coin).ToArray()); foreach (var element in send) @@ -392,7 +391,6 @@ namespace BTCPayServer.Controllers else builder.SendEstimatedFees(feeRateValue); } - builder.Shuffle(); var unsigned = builder.BuildTransaction(false); var keypaths = new Dictionary(); diff --git a/BTCPayServer/Payments/Changelly/Changelly.cs b/BTCPayServer/Payments/Changelly/Changelly.cs index f9505baed..61f04b9a6 100644 --- a/BTCPayServer/Payments/Changelly/Changelly.cs +++ b/BTCPayServer/Payments/Changelly/Changelly.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Net; using System.Net.Http; @@ -33,7 +34,7 @@ namespace BTCPayServer.Payments.Changelly var hex = new StringBuilder(array.Length * 2); foreach (var b in array) { - hex.AppendFormat("{0:x2}", b); + hex.AppendFormat(CultureInfo.InvariantCulture, "{0:x2}", b); } return hex.ToString(); @@ -102,7 +103,7 @@ namespace BTCPayServer.Payments.Changelly var result = await PostToApi(message); - return Convert.ToDecimal(result.Result); + return Convert.ToDecimal(result.Result, CultureInfo.InvariantCulture); } } }