1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2015 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
6 #ifndef BITCOIN_ADDRESSINDEX_H
7 #define BITCOIN_ADDRESSINDEX_H
12 struct CMempoolAddressDelta
19 CMempoolAddressDelta(int64_t t, CAmount a, uint256 hash, unsigned int out) {
26 CMempoolAddressDelta(int64_t t, CAmount a) {
34 struct CMempoolAddressDeltaKey
42 CMempoolAddressDeltaKey(int addressType, uint160 addressHash, uint256 hash, unsigned int i, int s) {
44 addressBytes = addressHash;
50 CMempoolAddressDeltaKey(int addressType, uint160 addressHash) {
52 addressBytes = addressHash;
59 struct CMempoolAddressDeltaKeyCompare
61 bool operator()(const CMempoolAddressDeltaKey& a, const CMempoolAddressDeltaKey& b) const {
62 if (a.type == b.type) {
63 if (a.addressBytes == b.addressBytes) {
64 if (a.txhash == b.txhash) {
65 if (a.index == b.index) {
66 return a.spending < b.spending;
68 return a.index < b.index;
71 return a.txhash < b.txhash;
74 return a.addressBytes < b.addressBytes;
77 return a.type < b.type;
82 #endif // BITCOIN_ADDRESSINDEX_H