Fix "Key already added in dictionary" error when signing with ledger

This commit is contained in:
nicolas.dorier 2019-08-07 17:53:03 +09:00
parent fb77fddcc3
commit 221e2c7898
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE

View File

@ -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();