Commit a9a90ee0 authored by Wladimir J. van der Laan's avatar Wladimir J. van der Laan
Browse files

Split up util.cpp/h

Split up util.cpp/h into:

- string utilities (hex, base32, base64): no internal dependencies, no dependency on boost (apart from foreach)
- money utilities (parsesmoney, formatmoney)
- time utilities (gettime*, sleep, format date):
- and the rest (logging, argument parsing, config file parsing)

The latter is basically the environment and OS handling,
and is stripped of all utility functions, so we may want to
rename it to something else than util.cpp/h for clarity (Matt suggested
osinterface).

Breaks dependency of sha256.cpp on all the things pulled in by util.
parent bc7aa300
master 14.0.0-testnet-require-standard 206-keys-hashes-opcodes 206-reg-spec-tx 211-agent-voting 89-merge-0.11-1st-stage 89-merge-bitcoin-latest-changes Current-dev NFT_HANG_HOT_FIX Testbranch add-testnet-option-to-script arm64 ashot-dev ashot-mn bitcoin-merge bitcoin-merge-wjf bitcore bitcore-current-dev bitcore-current-dev-fix-261 bitcore-v0.12.5.2 bitcore-v0.12.5.2-rc bug-template-updates build-experiments buildenv cherry-pick-61110e8c cherry-pick-9cf6a77a crown-ui current-dev-fix-261 develop-0.15 develop-platform difficulty-adjust docker-experiment evo-upgrade feature-350-asterisk-for-height fix-crown-cli fix-pi-build fix_depends_boost_location fontconfcheck issue-340-bionic-depends issue_115 issue_173 issue_371 main-testnet-integration mn-pos-fix pablon pablon-build-env patch-release-v0.12.5.3 patch_v0.13.4.1 printblock reduce-testnet-difficulty resolve-wallet-freeze spendfrom-enhancements testnet-stability v0.10.3-fix v0.14.2 v0.14.2rc2 v0.14.2rc1 v0.14.1 v0.14.1rc2 v0.14.1rc1 v0.14.0.4 v0.14.0.3 v0.14.0.2-Emerald v0.14.0.1-Emerald v0.14.0.0-Emerald v0.14.0 v0.14.0rc3 v0.14.0rc2 v0.14.0rc1 v0.13.4.0 v0.13.2.0 v0.13.2 v0.13.2rc1 v0.13.1 v0.13.1rc3 v0.13.1rc2 v0.13.1rc1 v0.13.0 v0.13.0rc3 v0.13.0rc2 v0.13.0rc1 v0.12.5.3 v0.12.5.2 v0.12.5.1 v0.12.5.0 v0.12.4.1 v0.12.4.0 v0.12.2.0 v0.12.1.0 v0.12.1 v0.12.1rc2 v0.12.1rc1 v0.12.0.61 v0.12.0 v0.12.0rc5 v0.12.0rc4 v0.12.0rc3 v0.12.0rc2 v0.12.0rc1 v0.11.3 v0.11.2 v0.11.2rc1 v0.11.1 v0.11.1rc2 v0.11.1rc1 v0.11.0 v0.11.0rc3 v0.11.0rc2 v0.11.0rc1 v0.10.5 v0.10.4 v0.10.4rc1 v0.10.3 v0.10.3rc2 v0.10.3rc1 v0.10.2 v0.10.2rc1 v0.10.1 v0.10.1rc3 v0.10.1rc2 v0.10.1rc1 v0.10.0 v0.10.0rc4 v0.10.0rc3 v0.10.0rc2 v0.10.0rc1 bitcore-bin-006 bitcore-bin-005 bitcore-bin-004 bitcore-bin-003 bitcore-bin-002 bitcore-bin-001
No related merge requests found
Showing with 32 additions and 3 deletions
+32 -3
......@@ -109,6 +109,9 @@ BITCOIN_CORE_H = \
ui_interface.h \
uint256.h \
util.h \
utilstrencodings.h \
utilmoneystr.h \
utiltime.h \
version.h \
walletdb.h \
wallet.h \
......@@ -219,6 +222,9 @@ libbitcoin_util_a_SOURCES = \
sync.cpp \
uint256.cpp \
util.cpp \
utilstrencodings.cpp \
utilmoneystr.cpp \
utiltime.cpp \
version.cpp \
$(BITCOIN_CORE_H)
......
......@@ -19,6 +19,7 @@
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/foreach.hpp>
#include <boost/thread.hpp>
using namespace std;
......
......@@ -8,6 +8,7 @@
#include "rpcclient.h"
#include "rpcprotocol.h"
#include "chainparamsbase.h"
#include "utilstrencodings.h"
#include "version.h"
#include <boost/filesystem/operations.hpp>
......
......@@ -4,6 +4,7 @@
#include "base58.h"
#include "util.h"
#include "utilmoneystr.h"
#include "core.h"
#include "main.h" // for MAX_BLOCK_SIZE
#include "keystore.h"
......
......@@ -12,6 +12,7 @@
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem.hpp>
#include <boost/thread.hpp>
/* Introduction text for doxygen: */
......
......@@ -8,6 +8,7 @@
#include "core.h"
#include "serialize.h"
#include "util.h"
#include "utilmoneystr.h"
#include "base58.h"
using namespace std;
......
......@@ -5,6 +5,7 @@
#include "crypter.h"
#include "script.h"
#include "util.h"
#include <string>
#include <vector>
......
......@@ -9,6 +9,7 @@
#include "hash.h"
#include "protocol.h"
#include "util.h"
#include "utilstrencodings.h"
#include <stdint.h>
......@@ -17,6 +18,7 @@
#endif
#include <boost/filesystem.hpp>
#include <boost/thread.hpp>
#include <boost/version.hpp>
#include <openssl/rand.h>
......
......@@ -19,6 +19,7 @@
#include "txdb.h"
#include "ui_interface.h"
#include "util.h"
#include "utilmoneystr.h"
#ifdef ENABLE_WALLET
#include "db.h"
#include "wallet.h"
......@@ -36,6 +37,7 @@
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem.hpp>
#include <boost/interprocess/sync/file_lock.hpp>
#include <boost/thread.hpp>
#include <openssl/crypto.h>
using namespace boost;
......
......@@ -8,6 +8,7 @@
#include "crypter.h"
#include "key.h"
#include "script.h"
#include "util.h"
#include <boost/foreach.hpp>
......
......@@ -24,6 +24,7 @@
#include <boost/algorithm/string/replace.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/thread.hpp>
using namespace std;
using namespace boost;
......
......@@ -3,8 +3,6 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <inttypes.h>
#include "miner.h"
#include "core.h"
......@@ -12,10 +10,14 @@
#include "main.h"
#include "net.h"
#include "pow.h"
#include "util.h"
#include "utilmoneystr.h"
#ifdef ENABLE_WALLET
#include "wallet.h"
#endif
#include <boost/thread.hpp>
using namespace std;
//////////////////////////////////////////////////////////////////////////////
......
......@@ -28,6 +28,7 @@
#endif
#include <boost/filesystem.hpp>
#include <boost/thread.hpp>
// Dump addresses to peers.dat every 15 minutes (900s)
#define DUMP_ADDRESSES_INTERVAL 900
......
......@@ -16,7 +16,7 @@
#include "random.h"
#include "sync.h"
#include "uint256.h"
#include "util.h"
#include "utilstrencodings.h"
#include <deque>
#include <stdint.h>
......@@ -25,6 +25,7 @@
#include <arpa/inet.h>
#endif
#include <boost/filesystem/path.hpp>
#include <boost/foreach.hpp>
#include <boost/signals2/signal.hpp>
......
......@@ -13,6 +13,7 @@
#include "sync.h"
#include "uint256.h"
#include "util.h"
#include "utilstrencodings.h"
#ifdef HAVE_GETADDRINFO_A
#include <netdb.h>
......@@ -27,6 +28,7 @@
#include <boost/algorithm/string/case_conv.hpp> // for to_lower()
#include <boost/algorithm/string/predicate.hpp> // for startswith() and endswith()
#include <boost/thread.hpp>
#if !defined(HAVE_MSG_NOSIGNAL) && !defined(MSG_NOSIGNAL)
#define MSG_NOSIGNAL 0
......
......@@ -8,6 +8,7 @@
#include "ui_interface.h"
#include "util.h"
#include <cstdio>
#include <stdint.h>
#include <string>
......
......@@ -9,6 +9,7 @@
#include "core.h"
#include "main.h"
#include "uint256.h"
#include "util.h"
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock)
{
......
......@@ -33,6 +33,7 @@
#include <stdint.h>
#include <boost/filesystem/operations.hpp>
#include <boost/thread.hpp>
#include <QApplication>
#include <QDebug>
#include <QLibraryInfo>
......
......@@ -24,6 +24,7 @@
#endif
#include "init.h"
#include "util.h"
#include "ui_interface.h"
#include <iostream>
......
......@@ -13,6 +13,7 @@
#include "main.h"
#include "net.h"
#include "ui_interface.h"
#include "util.h"
#include <stdint.h>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment