Don't remove from broadcast store
MODIFY
WalletWasabi/Blockchain/Mempool/MempoolService.cs
WalletWasabi/Blockchain/Mempool/MempoolService.cs
@@ -52,31 +52,24 @@ namespace WalletWasabi.Blockchain.Mempool
}
}
- public bool TryRemoveFromBroadcastStore(uint256 transactionHash)
+ public bool TryGetFromBroadcastStore(uint256 transactionHash, [NotNullWhen(true)] out TransactionBroadcastEntry? entry)
{
lock (BroadcastStoreLock)
{
- var found = BroadcastStore.FirstOrDefault(x => x.TransactionId == transactionHash);
-
- if (found is null)
- {
- return false;
- }
- else
- {
- BroadcastStore.RemoveAll(x => x.TransactionId == transactionHash);
- return true;
- }
+ entry = BroadcastStore.FirstOrDefault(x => x.TransactionId == transactionHash);
+ return entry is not null;
}
}
- public bool TryGetFromBroadcastStore(uint256 transactionHash, [NotNullWhen(true)] out TransactionBroadcastEntry? entry)
+ public SmartLabel TryGetLabel(uint256 txid)
{
- lock (BroadcastStoreLock)
+ var label = SmartLabel.Empty;
+ if (TryGetFromBroadcastStore(txid, out var entry))
{
- entry = BroadcastStore.FirstOrDefault(x => x.TransactionId == transactionHash);
- return entry is not null;
+ label = entry.Transaction.Label;
}
+
+ return label;
}
private int _cleanupInProcess;
@@ -174,16 +167,5 @@ namespace WalletWasabi.Blockchain.Mempool
TransactionReceived?.Invoke(this, txAdded);
}
}
-
- public SmartLabel TryGetLabel(uint256 txid)
- {
- var label = SmartLabel.Empty;
- if (TryGetFromBroadcastStore(txid, out var entry))
- {
- label = entry.Transaction.Label;
- }
-
- return label;
- }
}
}

MODIFY
WalletWasabi/Blockchain/TransactionBroadcasting/TransactionBroadcaster.cs
WalletWasabi/Blockchain/TransactionBroadcasting/TransactionBroadcaster.cs
@@ -193,10 +193,6 @@ namespace WalletWasabi.Blockchain.TransactionBroadcasting
await BroadcastTransactionToBackendAsync(transaction).ConfigureAwait(false);
}
}
- finally
- {
- BitcoinStore.MempoolService.TryRemoveFromBroadcastStore(transaction.GetHash()); // Remove it just to be sure. Probably has been removed previously.
- }
}
private async Task BroadcastTransactionWithRpcAsync(SmartTransaction transaction)

Don't remove from broadcast store