2016-01-18 15:33:29 +00:00
|
|
|
// Copyright (c) 2011-2016 The Cryptonote developers
|
2015-04-23 16:07:22 +00:00
|
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
2014-06-25 17:21:42 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2015-04-06 16:13:07 +00:00
|
|
|
#include "ITransaction.h"
|
|
|
|
#include <functional>
|
|
|
|
#include <cstring>
|
2014-06-25 17:21:42 +00:00
|
|
|
|
|
|
|
namespace CryptoNote {
|
|
|
|
|
2015-07-30 15:22:07 +00:00
|
|
|
inline bool operator==(const AccountPublicAddress &_v1, const AccountPublicAddress &_v2) {
|
|
|
|
return memcmp(&_v1, &_v2, sizeof(AccountPublicAddress)) == 0;
|
2015-04-06 16:13:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace std {
|
|
|
|
|
|
|
|
template<>
|
2015-07-30 15:22:07 +00:00
|
|
|
struct hash < CryptoNote::AccountPublicAddress > {
|
|
|
|
size_t operator()(const CryptoNote::AccountPublicAddress& val) const {
|
2015-04-06 16:13:07 +00:00
|
|
|
size_t spend = *(reinterpret_cast<const size_t*>(&val.spendPublicKey));
|
|
|
|
size_t view = *(reinterpret_cast<const size_t*>(&val.viewPublicKey));
|
|
|
|
return spend ^ view;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|