Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/ismine.h
- This file was moved from src/script/ismine.h.
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_SCRIPT_ISMINE_H | #ifndef BITCOIN_WALLET_ISMINE_H | ||||
#define BITCOIN_SCRIPT_ISMINE_H | #define BITCOIN_WALLET_ISMINE_H | ||||
#include <script/standard.h> | #include <script/standard.h> | ||||
#include <bitset> | #include <bitset> | ||||
#include <cstdint> | #include <cstdint> | ||||
class CKeyStore; | class CKeyStore; | ||||
class CScript; | class CScript; | ||||
/** IsMine() return codes */ | /** IsMine() return codes */ | ||||
enum isminetype { | enum isminetype : unsigned int { | ||||
ISMINE_NO = 0, | ISMINE_NO = 0, | ||||
ISMINE_WATCH_ONLY = 1 << 0, | ISMINE_WATCH_ONLY = 1 << 0, | ||||
ISMINE_SPENDABLE = 1 << 1, | ISMINE_SPENDABLE = 1 << 1, | ||||
ISMINE_ALL = ISMINE_WATCH_ONLY | ISMINE_SPENDABLE, | ISMINE_ALL = ISMINE_WATCH_ONLY | ISMINE_SPENDABLE, | ||||
ISMINE_ENUM_ELEMENTS, | ISMINE_ENUM_ELEMENTS, | ||||
}; | }; | ||||
/** used for bitflags of isminetype */ | /** used for bitflags of isminetype */ | ||||
Show All 11 Lines | struct CachableAmount { | ||||
Amount m_value[ISMINE_ENUM_ELEMENTS]; | Amount m_value[ISMINE_ENUM_ELEMENTS]; | ||||
inline void Reset() { m_cached.reset(); } | inline void Reset() { m_cached.reset(); } | ||||
void Set(isminefilter filter, Amount value) { | void Set(isminefilter filter, Amount value) { | ||||
m_cached.set(filter); | m_cached.set(filter); | ||||
m_value[filter] = value; | m_value[filter] = value; | ||||
} | } | ||||
}; | }; | ||||
#endif // BITCOIN_SCRIPT_ISMINE_H | #endif // BITCOIN_WALLET_ISMINE_H |