aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Ofsky <ryan@ofsky.org>2023-03-13 15:35:04 -0400
committerAndrew Chow <github@achow101.com>2023-04-11 15:52:25 -0400
commit2f8000513675467e62bee9d0f836d2fefcc479af (patch)
tree1f22faf5b539285bdfc708db70752308fa2a6561
parent8741522e6c75a0ad0c96f44e5668befc1624fb0b (diff)
downloadbitcoin-2f8000513675467e62bee9d0f836d2fefcc479af.tar.xz
wallet: add AddressPurpose enum to replace string values
-rw-r--r--src/wallet/types.h14
1 files changed, 14 insertions, 0 deletions
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<isminetype>::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