Merge bitcoin/bitcoin#23591: refactor: Use underlying type of isminetype for isminefilter

fa2c991ec93bc72d276f0dcd747b3e57c246139b refactor: Use underlying type of isminetype for isminefilter (MarcoFalke)

Pull request description:

  This does not change behavior, but it would be good for code clarity and to avoid `-Wimplicit-int-conversion` compiler warnings to use the an int of the same width for both `isminetype` and `isminefilter`.

ACKs for top commit:
  laanwj:
    Code review ACK fa2c991ec93bc72d276f0dcd747b3e57c246139b
  shaavan:
    crACK fa2c991ec93bc72d276f0dcd747b3e57c246139b
  promag:
    Code review ACK fa2c991ec93bc72d276f0dcd747b3e57c246139b.

Tree-SHA512: b3e255de7c9b1dea272bc8cb9386b339fe701f18580e03e997c270cac6453088ca2032e26e39f536d66cd1b6fda3e96bdbdc6e960879030e635338d0916277e6
This commit is contained in:
W. J. van der Laan 2021-11-29 13:02:48 +01:00 committed by Vijay
parent 96685be685
commit 78b06a4dd2
No known key found for this signature in database
GPG Key ID: 47820EC166FDF549
2 changed files with 7 additions and 6 deletions

View File

@ -14,13 +14,14 @@
#include <util/message.h>
#include <util/ui_change_type.h>
#include <cstdint>
#include <functional>
#include <map>
#include <memory>
#include <psbt.h>
#include <stdint.h>
#include <string>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>
@ -37,7 +38,7 @@ struct CRecipient;
struct PartiallySignedTransaction;
struct WalletContext;
struct bilingual_str;
typedef uint8_t isminefilter;
using isminefilter = std::underlying_type<isminetype>::type;
namespace interfaces {

View File

@ -8,8 +8,9 @@
#include <script/standard.h>
#include <stdint.h>
#include <bitset>
#include <cstdint>
#include <type_traits>
class CWallet;
class CScript;
@ -35,8 +36,7 @@ class CScript;
* ISMINE_USED: the scriptPubKey corresponds to a used address owned by the wallet user.
*
*/
enum isminetype : unsigned int
{
enum isminetype : unsigned int {
ISMINE_NO = 0,
ISMINE_WATCH_ONLY = 1 << 0,
ISMINE_SPENDABLE = 1 << 1,
@ -46,7 +46,7 @@ enum isminetype : unsigned int
ISMINE_ENUM_ELEMENTS,
};
/** used for bitflags of isminetype */
typedef uint8_t isminefilter;
using isminefilter = std::underlying_type<isminetype>::type;
/**
* Cachable amount subdivided into watchonly and spendable parts.