Bitcoin Core  21.99.0
P2P Digital Currency
ismine.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2019 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.
5 
6 #ifndef BITCOIN_WALLET_ISMINE_H
7 #define BITCOIN_WALLET_ISMINE_H
8 
9 #include <script/standard.h>
10 
11 #include <stdint.h>
12 #include <bitset>
13 
14 class CWallet;
15 class CScript;
16 
38 enum isminetype : unsigned int
39 {
40  ISMINE_NO = 0,
42  ISMINE_SPENDABLE = 1 << 1,
43  ISMINE_USED = 1 << 2,
47 };
49 typedef uint8_t isminefilter;
50 
55 {
56  // NO and ALL are never (supposed to be) cached
57  std::bitset<ISMINE_ENUM_ELEMENTS> m_cached;
59  inline void Reset()
60  {
61  m_cached.reset();
62  }
63  void Set(isminefilter filter, CAmount value)
64  {
65  m_cached.set(filter);
66  m_value[filter] = value;
67  }
68 };
69 
70 #endif // BITCOIN_WALLET_ISMINE_H
isminefilter
uint8_t isminefilter
Definition: wallet.h:36
ISMINE_ALL
@ ISMINE_ALL
Definition: ismine.h:44
ISMINE_WATCH_ONLY
@ ISMINE_WATCH_ONLY
Definition: ismine.h:41
CachableAmount::m_value
CAmount m_value[ISMINE_ENUM_ELEMENTS]
Definition: ismine.h:58
isminetype
isminetype
IsMine() return codes, which depend on ScriptPubKeyMan implementation.
Definition: ismine.h:38
CachableAmount::m_cached
std::bitset< ISMINE_ENUM_ELEMENTS > m_cached
Definition: ismine.h:57
CachableAmount::Set
void Set(isminefilter filter, CAmount value)
Definition: ismine.h:63
CAmount
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
standard.h
ISMINE_NO
@ ISMINE_NO
Definition: ismine.h:40
CScript
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:404
isminefilter
uint8_t isminefilter
used for bitflags of isminetype
Definition: ismine.h:49
ISMINE_ENUM_ELEMENTS
@ ISMINE_ENUM_ELEMENTS
Definition: ismine.h:46
ISMINE_SPENDABLE
@ ISMINE_SPENDABLE
Definition: ismine.h:42
CWallet
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Definition: wallet.h:638
ISMINE_USED
@ ISMINE_USED
Definition: ismine.h:43
CachableAmount::Reset
void Reset()
Definition: ismine.h:59
CachableAmount
Cachable amount subdivided into watchonly and spendable parts.
Definition: ismine.h:54
ISMINE_ALL_USED
@ ISMINE_ALL_USED
Definition: ismine.h:45