From 221e2c789879de04ff49d5ccb1f8e7ebd9b95cd3 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Wed, 7 Aug 2019 17:53:03 +0900 Subject: [PATCH] Fix "Key already added in dictionary" error when signing with ledger --- BTCPayServer/Services/LedgerHardwareWalletService.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BTCPayServer/Services/LedgerHardwareWalletService.cs b/BTCPayServer/Services/LedgerHardwareWalletService.cs index 5711fa91e..dea683799 100644 --- a/BTCPayServer/Services/LedgerHardwareWalletService.cs +++ b/BTCPayServer/Services/LedgerHardwareWalletService.cs @@ -126,11 +126,11 @@ namespace BTCPayServer.Services .Inputs .HDKeysFor(accountKey, accountKeyPath) .Where(hd => !hd.Coin.PartialSigs.ContainsKey(hd.PubKey)) // Don't want to sign something twice - .GroupBy(hd => hd.Coin) + .GroupBy(hd => hd.Coin.PrevOut, hd => hd) .Select(i => new SignatureRequest() { - InputCoin = i.Key.GetSignableCoin(), - InputTransaction = i.Key.NonWitnessUtxo, + InputCoin = i.First().Coin.GetSignableCoin(), + InputTransaction = i.First().Coin.NonWitnessUtxo, KeyPath = i.First().RootedKeyPath.KeyPath, PubKey = i.First().PubKey }).ToArray();