Fix label inheritance
MODIFY
WalletWasabi/BitcoinP2p/P2pBehavior.cs
WalletWasabi/BitcoinP2p/P2pBehavior.cs
@@ -97,7 +97,7 @@ namespace WalletWasabi.BitcoinP2p
try
{
- var txPayload = new TxPayload(entry.Transaction);
+ var txPayload = new TxPayload(entry.Transaction.Transaction);
if (!node.IsConnected)
{
Logger.LogInfo($"Could not serve transaction. Node ({node.RemoteSocketEndpoint}) is not connected anymore: {entry.TransactionId}.");

MODIFY
WalletWasabi/Blockchain/Mempool/MempoolService.cs
WalletWasabi/Blockchain/Mempool/MempoolService.cs
@@ -34,7 +34,7 @@ namespace WalletWasabi.Blockchain.Mempool
private object BroadcastStoreLock { get; }
public bool TrustedNodeMode { get; set; }
- public bool TryAddToBroadcastStore(Transaction transaction, string nodeRemoteSocketEndpoint)
+ public bool TryAddToBroadcastStore(SmartTransaction transaction, string nodeRemoteSocketEndpoint)
{
lock (BroadcastStoreLock)
{
@@ -158,9 +158,16 @@ namespace WalletWasabi.Blockchain.Mempool
lock (ProcessedLock)
{
if (ProcessedTransactionHashes.Add(tx.GetHash()))
+ {
+ if (TryGetFromBroadcastStore(tx.GetHash(), out var entry))
+ {
+ txAdded = entry.Transaction;
+ }
+ else
{
txAdded = new SmartTransaction(tx, Height.Mempool);
}
+ }
else
{
Interlocked.Increment(ref _duplicatedReceives);

MODIFY
WalletWasabi/Blockchain/TransactionBroadcasting/TransactionBroadcaster.cs
WalletWasabi/Blockchain/TransactionBroadcasting/TransactionBroadcaster.cs
@@ -43,7 +43,7 @@ namespace WalletWasabi.Blockchain.TransactionBroadcasting
private async Task BroadcastTransactionToNetworkNodeAsync(SmartTransaction transaction, Node node)
{
Logger.LogInfo($"Trying to broadcast transaction with random node ({node.RemoteSocketAddress}):{transaction.GetHash()}.");
- if (!BitcoinStore.MempoolService.TryAddToBroadcastStore(transaction.Transaction, node.RemoteSocketEndpoint.ToString())) // So we'll reply to INV with this transaction.
+ if (!BitcoinStore.MempoolService.TryAddToBroadcastStore(transaction, node.RemoteSocketEndpoint.ToString())) // So we'll reply to INV with this transaction.
{
Logger.LogWarning($"Transaction {transaction.GetHash()} was already present in the broadcast store.");
}

MODIFY
WalletWasabi/Blockchain/Transactions/TransactionBroadcastEntry.cs
WalletWasabi/Blockchain/Transactions/TransactionBroadcastEntry.cs
@@ -4,7 +4,7 @@ namespace WalletWasabi.Blockchain.Transactions
{
public class TransactionBroadcastEntry
{
- public TransactionBroadcastEntry(Transaction transaction, string nodeRemoteSocketEndpoint)
+ public TransactionBroadcastEntry(SmartTransaction transaction, string nodeRemoteSocketEndpoint)
{
Lock = new object();
Transaction = transaction;
@@ -14,7 +14,7 @@ namespace WalletWasabi.Blockchain.Transactions
NodeRemoteSocketEndpoint = nodeRemoteSocketEndpoint;
}
- public Transaction Transaction { get; }
+ public SmartTransaction Transaction { get; }
public uint256 TransactionId { get; }
public string NodeRemoteSocketEndpoint { get; }

Fix label inheritance