diff --git a/src/Helpers/LightningHelper.cs b/src/Helpers/LightningHelper.cs
index ba93a382..5d0b0770 100644
--- a/src/Helpers/LightningHelper.cs
+++ b/src/Helpers/LightningHelper.cs
@@ -30,7 +30,7 @@ public static void RemoveDuplicateUTXOs(this UTXOChanges utxoChanges)
///
///
///
- public static void AddDerivationData(ILogger logger, IEnumerable keys , (PSBT?, bool) result, List selectedUtxOs,
+ public static (PSBT?, bool) AddDerivationData(ILogger logger, IEnumerable keys , (PSBT?, bool) result, List selectedUtxOs,
List multisigCoins)
{
if (logger == null) throw new ArgumentNullException(nameof(logger));
@@ -41,8 +41,9 @@ public static void AddDerivationData(ILogger logger, IEnumerable keys , (PS
var nbXplorerNetwork = CurrentNetworkHelper.GetCurrentNetwork();
foreach (var key in keys)
{
+ if (string.IsNullOrWhiteSpace(key.MasterFingerprint) || string.IsNullOrWhiteSpace(key.XPUB)) continue;
+
var bitcoinExtPubKey = new BitcoinExtPubKey(key.XPUB, nbXplorerNetwork);
-
var masterFingerprint = HDFingerprint.Parse(key.MasterFingerprint);
var rootedKeyPath = new RootedKeyPath(masterFingerprint, new KeyPath(key.Path));
@@ -74,6 +75,8 @@ public static void AddDerivationData(ILogger logger, IEnumerable keys , (PS
}
}
}
+
+ return result;
}
diff --git a/src/Services/BitcoinService.cs b/src/Services/BitcoinService.cs
index f825fa61..5ddc03f7 100644
--- a/src/Services/BitcoinService.cs
+++ b/src/Services/BitcoinService.cs
@@ -195,7 +195,7 @@ public BitcoinService(ILogger logger,
result.Item1 = builder.BuildPSBT(false);
//Additional fields to support PSBT signing with a HW or the Remote Signer
- LightningHelper.AddDerivationData(_logger,walletWithdrawalRequest.Wallet.Keys, result, selectedUTXOs, scriptCoins);
+ result = LightningHelper.AddDerivationData(_logger,walletWithdrawalRequest.Wallet.Keys, result, selectedUTXOs, scriptCoins);
}
catch (Exception e)
{
diff --git a/src/Services/LightningService.cs b/src/Services/LightningService.cs
index cc216aac..1fb3e4a3 100644
--- a/src/Services/LightningService.cs
+++ b/src/Services/LightningService.cs
@@ -830,7 +830,7 @@ private void CancelPendingChannel(Node source, Lightning.LightningClient client,
}
//Additional fields to support PSBT signing with a HW or the Remote Signer
- LightningHelper.AddDerivationData(_logger,channelOperationRequest.Wallet.Keys, result, selectedUtxOs, multisigCoins);
+ result = LightningHelper.AddDerivationData(_logger,channelOperationRequest.Wallet.Keys, result, selectedUtxOs, multisigCoins);
}
catch (Exception e)
{