Skip to content

Commit fa2c991

Browse files
author
MarcoFalke
committed
refactor: Use underlying type of isminetype for isminefilter
1 parent 76392b0 commit fa2c991

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/interfaces/wallet.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
#include <util/message.h>
1414
#include <util/ui_change_type.h>
1515

16+
#include <cstdint>
1617
#include <functional>
1718
#include <map>
1819
#include <memory>
19-
#include <stdint.h>
2020
#include <string>
2121
#include <tuple>
22+
#include <type_traits>
2223
#include <utility>
2324
#include <vector>
2425

@@ -34,7 +35,7 @@ struct CRecipient;
3435
struct PartiallySignedTransaction;
3536
struct WalletContext;
3637
struct bilingual_str;
37-
typedef uint8_t isminefilter;
38+
using isminefilter = std::underlying_type<isminetype>::type;
3839

3940
namespace interfaces {
4041

src/wallet/ismine.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88

99
#include <script/standard.h>
1010

11-
#include <stdint.h>
1211
#include <bitset>
12+
#include <cstdint>
13+
#include <type_traits>
1314

1415
class CWallet;
1516
class CScript;
@@ -35,8 +36,7 @@ class CScript;
3536
* ISMINE_USED: the scriptPubKey corresponds to a used address owned by the wallet user.
3637
*
3738
*/
38-
enum isminetype : unsigned int
39-
{
39+
enum isminetype : unsigned int {
4040
ISMINE_NO = 0,
4141
ISMINE_WATCH_ONLY = 1 << 0,
4242
ISMINE_SPENDABLE = 1 << 1,
@@ -46,7 +46,7 @@ enum isminetype : unsigned int
4646
ISMINE_ENUM_ELEMENTS,
4747
};
4848
/** used for bitflags of isminetype */
49-
typedef uint8_t isminefilter;
49+
using isminefilter = std::underlying_type<isminetype>::type;
5050

5151
/**
5252
* Cachable amount subdivided into watchonly and spendable parts.

0 commit comments

Comments
 (0)