Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 33 additions & 17 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,21 @@ BITCOIN_CORE_H = \
ui_interface.h \
undo.h \
unordered_lru_cache.h \
util.h \
utilasmap.h \
utilmemory.h \
utilmoneystr.h \
utilstring.h \
utiltime.h \
utilthreadnames.h \
util/bytevectorhash.h \
util/error.h \
util/fees.h \
util/system.h \
util/asmap.h \
util/macros.h \
util/memory.h \
util/moneystr.h \
util/serfloat.h \
util/string.h \
util/time.h \
util/threadnames.h \
util/vector.h \
util/url.h \
util/validation.h \
validation.h \
validationinterface.h \
versionbits.h \
Expand Down Expand Up @@ -444,7 +452,9 @@ crypto_libdash_crypto_base_a_SOURCES = \
crypto/sha3.cpp \
crypto/sha3.h \
crypto/sha512.cpp \
crypto/sha512.h
crypto/sha512.h \
crypto/siphash.cpp \
crypto/siphash.h

if USE_ASM
crypto_libdash_crypto_base_a_SOURCES += crypto/sha256_sse4.cpp
Expand Down Expand Up @@ -529,8 +539,8 @@ libdash_consensus_a_SOURCES = \
tinyformat.h \
uint256.cpp \
uint256.h \
utilstrencodings.cpp \
utilstrencodings.h \
util/strencodings.cpp \
util/strencodings.h \
version.h

# common: shared between dashd, and dash-qt and non-server tools
Expand Down Expand Up @@ -588,13 +598,19 @@ libdash_util_a_SOURCES = \
support/cleanse.cpp \
sync.cpp \
threadinterrupt.cpp \
util.cpp \
utilasmap.cpp \
utilmoneystr.cpp \
utilstrencodings.cpp \
utiltime.cpp \
utilstring.cpp \
utilthreadnames.cpp \
util/bytevectorhash.cpp \
util/error.cpp \
util/fees.cpp \
util/system.cpp \
util/asmap.cpp \
util/moneystr.cpp \
util/strencodings.cpp \
util/time.cpp \
util/serfloat.cpp \
util/string.cpp \
util/threadnames.cpp \
util/url.cpp \
util/validation.cpp \
$(BITCOIN_CORE_H)

if GLIBC_BACK_COMPAT
Expand Down
2 changes: 1 addition & 1 deletion src/addrdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <random.h>
#include <streams.h>
#include <tinyformat.h>
#include <util.h>
#include <util/system.h>

namespace {

Expand Down
2 changes: 1 addition & 1 deletion src/addrman.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <sync.h>
#include <timedata.h>
#include <tinyformat.h>
#include <util.h>
#include <util/system.h>

#include <fs.h>
#include <hash.h>
Expand Down
2 changes: 1 addition & 1 deletion src/arith_uint256.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <arith_uint256.h>

#include <uint256.h>
#include <utilstrencodings.h>
#include <util/strencodings.h>
#include <crypto/common.h>

#include <stdio.h>
Expand Down
13 changes: 0 additions & 13 deletions src/attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,6 @@
#ifndef BITCOIN_ATTRIBUTES_H
#define BITCOIN_ATTRIBUTES_H

#if defined(__has_cpp_attribute)
# if __has_cpp_attribute(nodiscard)
# define NODISCARD [[nodiscard]]
# endif
#endif
#ifndef NODISCARD
# if defined(_MSC_VER) && _MSC_VER >= 1700
# define NODISCARD _Check_return_
# else
# define NODISCARD __attribute__((warn_unused_result))
# endif
#endif

#if defined(__clang__)
# if __has_attribute(lifetimebound)
# define LIFETIMEBOUND [[clang::lifetimebound]]
Expand Down
4 changes: 2 additions & 2 deletions src/base58.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include <hash.h>
#include <uint256.h>
#include <utilstrencodings.h>
#include <utilstring.h>
#include <util/strencodings.h>
#include <util/string.h>

#include <assert.h>
#include <stdint.h>
Expand Down
8 changes: 4 additions & 4 deletions src/base58.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ std::string EncodeBase58(const std::vector<unsigned char>& vch);
* return true if decoding is successful.
* psz cannot be nullptr.
*/
NODISCARD bool DecodeBase58(const char* psz, std::vector<unsigned char>& vchRet);
[[nodiscard]] bool DecodeBase58(const char* psz, std::vector<unsigned char>& vchRet);

/**
* Decode a base58-encoded string (str) into a byte vector (vchRet).
* return true if decoding is successful.
*/
NODISCARD bool DecodeBase58(const std::string& str, std::vector<unsigned char>& vchRet);
[[nodiscard]] bool DecodeBase58(const std::string& str, std::vector<unsigned char>& vchRet);

/**
* Encode a byte vector into a base58-encoded string, including checksum
Expand All @@ -52,12 +52,12 @@ std::string EncodeBase58Check(const std::vector<unsigned char>& vchIn);
* Decode a base58-encoded string (psz) that includes a checksum into a byte
* vector (vchRet), return true if decoding is successful
*/
NODISCARD bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet);
[[nodiscard]] bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet);

/**
* Decode a base58-encoded string (str) that includes a checksum into a byte
* vector (vchRet), return true if decoding is successful
*/
NODISCARD bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet);
[[nodiscard]] bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet);

#endif // BITCOIN_BASE58_H
2 changes: 1 addition & 1 deletion src/batchedlogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <batchedlogger.h>
#include <util.h>
#include <util/system.h>

CBatchedLogger::CBatchedLogger(BCLog::LogFlags _category, const std::string& _header) :
accept(LogAcceptCategory(_category)), header(_header)
Expand Down
8 changes: 1 addition & 7 deletions src/bech32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <bech32.h>
#include <util/vector.h>

namespace
{
Expand All @@ -24,13 +25,6 @@ const int8_t CHARSET_REV[128] = {
1, 0, 3, 16, 11, 28, 12, 14, 6, 4, 2, -1, -1, -1, -1, -1
};

/** Concatenate two byte arrays. */
data Cat(data x, const data& y)
{
x.insert(x.end(), y.begin(), y.end());
return x;
}

/** This function will compute what 6 5-bit values to XOR into the last 6 input values, in order to
* make the checksum 0. These 6 values are packed together in a single 30-bit integer. The higher
* bits correspond to earlier values. */
Expand Down
2 changes: 1 addition & 1 deletion src/bench/bench_dash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <key.h>
#include <stacktraces.h>
#include <validation.h>
#include <util.h>
#include <util/system.h>
#include <random.h>

#include <boost/lexical_cast.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/bench/bls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <bench/bench.h>
#include <random.h>
#include <bls/bls_worker.h>
#include <utiltime.h>
#include <util/time.h>

#include <iostream>

Expand Down
2 changes: 1 addition & 1 deletion src/bench/checkqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <bench/bench.h>
#include <util.h>
#include <util/system.h>
#include <validation.h>
#include <checkqueue.h>
#include <prevector.h>
Expand Down
3 changes: 2 additions & 1 deletion src/bench/crypto_hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
#include <hash.h>
#include <random.h>
#include <uint256.h>
#include <utiltime.h>
#include <util/time.h>
#include <crypto/ripemd160.h>
#include <crypto/sha1.h>
#include <crypto/sha256.h>
#include <crypto/sha3.h>
#include <crypto/sha512.h>
#include <crypto/siphash.h>

/* Number of bytes to hash per iteration */
static const uint64_t BUFFER_SIZE = 1000*1000;
Expand Down
2 changes: 1 addition & 1 deletion src/bench/examples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <bench/bench.h>
#include <validation.h>
#include <utiltime.h>
#include <util/time.h>

// Sanity test: this should loop ten times, and
// min/max/average should be close to 100ms.
Expand Down
2 changes: 1 addition & 1 deletion src/bench/string_cast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <bench/bench.h>
#include <tinyformat.h>
#include <utilstrencodings.h>
#include <util/strencodings.h>

#include <boost/lexical_cast.hpp>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion src/bench/util_time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <bench/bench.h>

#include <utiltime.h>
#include <util/time.h>

static void BenchTimeDeprecated(benchmark::State& state)
{
Expand Down
5 changes: 3 additions & 2 deletions src/blockencodings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
#include <consensus/consensus.h>
#include <consensus/validation.h>
#include <chainparams.h>
#include <hash.h>
#include <crypto/sha256.h>
#include <crypto/siphash.h>
#include <random.h>
#include <streams.h>
#include <txmempool.h>
#include <validation.h>
#include <util.h>
#include <util/system.h>

#include <unordered_map>

Expand Down
1 change: 1 addition & 0 deletions src/blockfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <blockfilter.h>
#include <crypto/siphash.h>
#include <hash.h>
#include <primitives/transaction.h>
#include <script/script.h>
Expand Down
5 changes: 3 additions & 2 deletions src/blockfilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
#ifndef BITCOIN_BLOCKFILTER_H
#define BITCOIN_BLOCKFILTER_H

#include <set>
#include <stdint.h>
#include <unordered_set>
#include <vector>

#include <primitives/block.h>
#include <serialize.h>
#include <uint256.h>
#include <undo.h>
#include <util/bytevectorhash.h>

/**
* This implements a Golomb-coded set as defined in BIP 158. It is a
Expand All @@ -22,7 +23,7 @@ class GCSFilter
{
public:
typedef std::vector<unsigned char> Element;
typedef std::set<Element> ElementSet;
typedef std::unordered_set<Element, ByteVectorHash> ElementSet;

private:
uint64_t m_siphash_k0;
Expand Down
2 changes: 1 addition & 1 deletion src/bls/bls.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <hash.h>
#include <serialize.h>
#include <uint256.h>
#include <utilstrencodings.h>
#include <util/strencodings.h>

// bls-dash uses relic, which may define DEBUG and ERROR, which leads to many warnings in some build setups
#undef ERROR
Expand Down
2 changes: 1 addition & 1 deletion src/bls/bls_worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <hash.h>
#include <serialize.h>

#include <util.h>
#include <util/system.h>

#include <memory>
#include <utility>
Expand Down
4 changes: 2 additions & 2 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <consensus/merkle.h>

#include <tinyformat.h>
#include <util.h>
#include <utilstrencodings.h>
#include <util/system.h>
#include <util/strencodings.h>

#include <arith_uint256.h>

Expand Down
4 changes: 2 additions & 2 deletions src/chainparamsbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <chainparamsbase.h>

#include <tinyformat.h>
#include <util.h>
#include <utilmemory.h>
#include <util/system.h>
#include <util/memory.h>

#include <assert.h>

Expand Down
2 changes: 1 addition & 1 deletion src/checkqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <sync.h>
#include <tinyformat.h>
#include <utilthreadnames.h>
#include <util/threadnames.h>

#include <algorithm>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion src/coinjoin/coinjoin-client-options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <coinjoin/coinjoin-client-options.h>

#include <util.h>
#include <util/system.h>
#include <univalue.h>

#include <cassert>
Expand Down
4 changes: 2 additions & 2 deletions src/coinjoin/coinjoin-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include <net_processing.h>
#include <script/sign.h>
#include <txmempool.h>
#include <util.h>
#include <utilmoneystr.h>
#include <util/system.h>
#include <util/moneystr.h>
#include <validation.h>
#include <version.h>
#include <wallet/coincontrol.h>
Expand Down
4 changes: 2 additions & 2 deletions src/coinjoin/coinjoin-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include <netmessagemaker.h>
#include <script/interpreter.h>
#include <txmempool.h>
#include <util.h>
#include <utilmoneystr.h>
#include <util/system.h>
#include <util/moneystr.h>
#include <validation.h>
#include <version.h>

Expand Down
Loading