btcpayserver/BTCPayServer/TransactionComparer.cs

31 lines
699 B
C#
Raw Normal View History

2017-11-06 09:31:02 +01:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using NBitcoin;
namespace BTCPayServer
{
public class TransactionComparer : IEqualityComparer<Transaction>
{
private static TransactionComparer _Instance = new TransactionComparer();
public static TransactionComparer Instance
{
get
{
return _Instance;
}
}
public bool Equals(Transaction x, Transaction y)
{
return x.GetHash() == y.GetHash();
}
public int GetHashCode(Transaction obj)
{
return obj.GetHash().GetHashCode();
}
}
}