Improve smarttransaction extraction.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
@@ -380,7 +380,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
await PinPadViewModel.UnlockAsync(Global);
signedPsbt = await client.SignTxAsync(KeyManager.MasterFingerprint.Value, result.Psbt, cts.Token);
}
- signedTransaction = signedPsbt.ExtractSmartTransaction(result.Transaction.Height, result.Transaction.BlockHash, result.Transaction.BlockIndex, result.Transaction.Label, result.Transaction.FirstSeen, result.Transaction.IsReplacement);
+ signedTransaction = signedPsbt.ExtractSmartTransaction(result.Transaction);
}
}
catch (Exception ex)

MODIFY
WalletWasabi/Extensions/NBitcoinExtensions.cs
WalletWasabi/Extensions/NBitcoinExtensions.cs
@@ -251,13 +251,20 @@ namespace NBitcoin
public static SmartTransaction ExtractSmartTransaction(this PSBT psbt)
{
- return psbt.ExtractSmartTransaction(Height.Unknown);
+ var extractedTx = psbt.ExtractTransaction();
+ return new SmartTransaction(extractedTx, Height.Unknown);
}
- public static SmartTransaction ExtractSmartTransaction(this PSBT psbt, Height height, uint256 blockHash = null, int blockIndex = 0, SmartLabel label = null, DateTimeOffset firstSeen = default, bool isReplacement = false)
+ public static SmartTransaction ExtractSmartTransaction(this PSBT psbt, SmartTransaction unsignedSmartTransaction)
{
var extractedTx = psbt.ExtractTransaction();
- return new SmartTransaction(extractedTx, height, blockHash, blockIndex, label, isReplacement, firstSeen);
+ return new SmartTransaction(extractedTx,
+ unsignedSmartTransaction.Height,
+ unsignedSmartTransaction.BlockHash,
+ unsignedSmartTransaction.BlockIndex,
+ unsignedSmartTransaction.Label,
+ unsignedSmartTransaction.IsReplacement,
+ unsignedSmartTransaction.FirstSeen);
}
public static void SortByAmount(this TxOutList list)

Improve smarttransaction extraction.