From 7a172c76d2361fc3cdf6345590e26c79a7821672 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Tue, 8 Aug 2023 10:57:31 -0400 Subject: Move CTxDestination to its own file CTxDestination is really our internal representation of an address and doesn't really have anything to do with standard script types, so move them to their own file. --- src/Makefile.am | 2 + src/addresstype.cpp | 150 +++++++++++++++++++++++++++++++++++ src/addresstype.h | 121 ++++++++++++++++++++++++++++ src/bench/descriptors.cpp | 1 - src/interfaces/wallet.h | 8 +- src/key_io.h | 1 + src/outputtype.h | 2 +- src/script/signingprovider.h | 1 + src/script/standard.cpp | 135 ------------------------------- src/script/standard.h | 105 ------------------------ src/test/blockfilter_index_tests.cpp | 1 + src/test/coins_tests.cpp | 1 + src/test/fuzz/util.h | 1 + src/test/miner_tests.cpp | 1 + src/test/miniscript_tests.cpp | 1 + src/test/sigopcount_tests.cpp | 1 + src/test/txindex_tests.cpp | 1 + src/wallet/scriptpubkeyman.h | 1 + src/wallet/test/util.h | 2 +- src/wallet/test/wallet_tests.cpp | 1 + src/wallet/wallet.h | 1 + 21 files changed, 291 insertions(+), 247 deletions(-) create mode 100644 src/addresstype.cpp create mode 100644 src/addresstype.h diff --git a/src/Makefile.am b/src/Makefile.am index a108e60c86..3efc008e33 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -117,6 +117,7 @@ endif .PHONY: FORCE check-symbols check-security # bitcoin core # BITCOIN_CORE_H = \ + addresstype.h \ addrdb.h \ addrman.h \ addrman_impl.h \ @@ -657,6 +658,7 @@ libbitcoin_consensus_a_SOURCES = \ libbitcoin_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS) libbitcoin_common_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) libbitcoin_common_a_SOURCES = \ + addresstype.cpp \ base58.cpp \ bech32.cpp \ chainparams.cpp \ diff --git a/src/addresstype.cpp b/src/addresstype.cpp new file mode 100644 index 0000000000..96428df846 --- /dev/null +++ b/src/addresstype.cpp @@ -0,0 +1,150 @@ +// Copyright (c) 2023 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or https://www.opensource.org/licenses/mit-license.php. + +#include +#include