From 2f8000513675467e62bee9d0f836d2fefcc479af Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Mon, 13 Mar 2023 15:35:04 -0400 Subject: [PATCH] wallet: add AddressPurpose enum to replace string values --- src/wallet/types.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/wallet/types.h b/src/wallet/types.h index 8c1f72f131..6198f1ae33 100644 --- a/src/wallet/types.h +++ b/src/wallet/types.h @@ -48,6 +48,20 @@ enum isminetype : unsigned int { }; /** used for bitflags of isminetype */ using isminefilter = std::underlying_type::type; + +/** + * Address purpose field that has been been stored with wallet sending and + * receiving addresses since BIP70 payment protocol support was added in + * https://github.com/bitcoin/bitcoin/pull/2539. This field is not currently + * used for any logic inside the wallet, but it is still shown in RPC and GUI + * interfaces and saved for new addresses. It is basically redundant with an + * address's IsMine() result. + */ +enum class AddressPurpose { + RECEIVE, + SEND, + REFUND, //!< Never set in current code may be present in older wallet databases +}; } // namespace wallet #endif // BITCOIN_WALLET_TYPES_H