Optimize Load wallet - Don't mind transactions those aren't spending or receiving segwit at all
MODIFY
WalletWasabi/Extensions/NBitcoinExtensions.cs
WalletWasabi/Extensions/NBitcoinExtensions.cs
@@ -34,6 +34,8 @@ namespace NBitcoin
me.FromBytes(ByteHelpers.FromHex(hex));
}
+ public static bool SpendsOrReceivesWitness(this Transaction me) => me.HasWitness || me.Outputs.Any(x => x.ScriptPubKey.IsWitness);
+
public static IEnumerable<(Money value, int count)> GetIndistinguishableOutputs(this Transaction me)
{
return me.Outputs.GroupBy(x => x.Value)

MODIFY
WalletWasabi/Services/WalletService.cs
WalletWasabi/Services/WalletService.cs
@@ -384,6 +384,7 @@ namespace WalletWasabi.Services
if (tx.Height.Type == HeightType.Chain)
{
MemPool.TransactionHashes.TryRemove(txId); // If we have in mempool, remove.
+ if (!tx.Transaction.SpendsOrReceivesWitness()) return; // We don't care about non-witness transactions for other than mempool cleanup.
bool isFoundTx = TransactionCache.Contains(tx); // If we have in cache, update height.
if (isFoundTx)
@@ -395,6 +396,7 @@ namespace WalletWasabi.Services
}
}
}
+ if (!tx.Transaction.SpendsOrReceivesWitness()) return; // We don't care about non-witness transactions for other than mempool cleanup.
//iterate tx
// if already have the coin

Optimize Load wallet - Don't mind transactions those aren't spending or receiving segwit at all