Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7708808
Merge #10684: Remove no longer used mempool.exists(outpoint)
laanwj Jun 28, 2017
9bcadeb
Merge #10631: Use the override specifier (C++11) where we expect to b…
laanwj Jun 28, 2017
0a21569
Merge #10685: Clarify CCoinsViewMemPool documentation.
sipa Jun 28, 2017
184847c
Merge #10673: [qt] Avoid potential null pointer dereference in Transa…
laanwj Jun 29, 2017
9221e0d
Merge #10728: fix typo in help text for removeprunedfunds
jonasschnelli Jul 3, 2017
a60f1e2
Merge #10710: REST/RPC example update
laanwj Jul 6, 2017
6e2f779
Merge #10747: [rpc] fix verbose argument for getblock in bitcoin-cli
laanwj Jul 10, 2017
cf40b54
Merge #10676: document script-based return fields for validateaddress
laanwj Jul 11, 2017
f1c9b7a
Merge #10190: [tests] mining functional tests (including regression t…
laanwj Jul 11, 2017
b195cbb
Merge #10651: Verify binaries from bitcoincore.org and bitcoin.org
laanwj Jul 11, 2017
ec01825
Merge #10786: Add PR description to merge commit in github-merge.py
laanwj Jul 11, 2017
28197ef
Merge #10714: Avoid printing incorrect block indexing time due to uni…
sipa Jul 12, 2017
526036e
Merge #9804: Fixes subscript 0 (&var[0]) where should use (var.data()…
sipa Jul 12, 2017
09854d6
Merge #10780: Simplify "!foo || (foo && bar)" as "!foo || bar"
sipa Jul 13, 2017
a0ff957
Merge #10806: build: verify that the assembler can handle crc32 funct…
laanwj Jul 14, 2017
1717720
Merge #10557: Make check to distinguish between orphan txs and old tx…
sipa Jul 14, 2017
b14bd20
Merge #10819: Fix uninitialized atomic variables
sipa Jul 14, 2017
29760e7
Merge #10808: Avoid some new gcc warnings in 15
sipa Jul 15, 2017
38f52f8
Merge #10816: Properly forbid -salvagewallet and -zapwallettxes for m…
sipa Jul 15, 2017
445e8d8
Merge #10807: getbalance example covers at least 6 confirms
sipa Jul 15, 2017
483786a
Merge #10812: [utils] Allow bitcoin-cli's -rpcconnect option to be us…
sipa Jul 15, 2017
6d856ae
Merge #10820: Use cpuid intrinsics instead of asm code
sipa Jul 16, 2017
d7057d4
Merge #10766: Building Environment: Set ARFLAGS to cr
sipa Jul 16, 2017
c097ab8
Merge #10840: Remove duplicate include
sipa Jul 16, 2017
188f4a7
Merge #10735: Avoid static analyzer warnings regarding uninitialized …
sipa Jul 16, 2017
2b9216e
/s/BTC/DASH
PastaPastaPasta Jul 17, 2019
0eae9ed
remove witness comment/text
PastaPastaPasta Jul 18, 2019
a4f046c
adjust formatting from review configure.ac
PastaPastaPasta Jul 18, 2019
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
34 changes: 32 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ BITCOIN_GUI_NAME=dash-qt
BITCOIN_CLI_NAME=dash-cli
BITCOIN_TX_NAME=dash-tx

dnl Unless the user specified ARFLAGS, force it to be cr
AC_ARG_VAR(ARFLAGS, [Flags for the archiver, defaults to <cr> if not set])
if test "x${ARFLAGS+set}" != "xset"; then
ARFLAGS="cr"
fi

AC_CANONICAL_HOST

AH_TOP([#ifndef DASH_CONFIG_H])
Expand Down Expand Up @@ -290,9 +296,32 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
# Check for optional instruction set support. Enabling these does _not_ imply that all code will
# be compiled with them, rather that specific objects/libs may use them after checking for runtime
# compatibility.
AX_CHECK_COMPILE_FLAG([-msse4.2],[[enable_sse42=yes; SSE42_CXXFLAGS="-msse4.2"]],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-msse4.2],[[SSE42_CXXFLAGS="-msse4.2"]],,[[$CXXFLAG_WERROR]])

fi

TEMP_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $SSE42_CXXFLAGS"
AC_MSG_CHECKING(for assembler crc32 support)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdint.h>
#if defined(_MSC_VER)
#include <intrin.h>
#elif defined(__GNUC__) && defined(__SSE4_2__)
#include <nmmintrin.h>
#endif
]],[[
uint64_t l = 0;
l = _mm_crc32_u8(l, 0);
l = _mm_crc32_u32(l, 0);
l = _mm_crc32_u64(l, 0);
return l;
]])],
[ AC_MSG_RESULT(yes); enable_hwcrc32=yes],
[ AC_MSG_RESULT(no)]
)
CXXFLAGS="$TEMP_CXXFLAGS"

CPPFLAGS="$CPPFLAGS -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS"

AC_ARG_WITH([utils],
Expand Down Expand Up @@ -1188,7 +1217,7 @@ AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes])
AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes])
AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes])
AM_CONDITIONAL([HARDEN],[test x$use_hardening = xyes])
AM_CONDITIONAL([ENABLE_SSE42],[test x$enable_sse42 = xyes])
AM_CONDITIONAL([ENABLE_HWCRC32],[test x$enable_hwcrc32 = xyes])

AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])
AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])
Expand Down Expand Up @@ -1321,4 +1350,5 @@ echo " CPPFLAGS = $CPPFLAGS"
echo " CXX = $CXX"
echo " CXXFLAGS = $CXXFLAGS"
echo " LDFLAGS = $LDFLAGS"
echo " ARFLAGS = $ARFLAGS"
echo
2 changes: 2 additions & 0 deletions contrib/devtools/github-merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def main():
if info is None:
exit(1)
title = info['title'].strip()
body = info['body'].strip()
# precedence order for destination branch argument:
# - command line argument
# - githubmerge.branch setting
Expand Down Expand Up @@ -229,6 +230,7 @@ def main():
firstline = 'Merge #%s' % (pull,)
message = firstline + '\n\n'
message += subprocess.check_output([GIT,'log','--no-merges','--topo-order','--pretty=format:%h %s (%an)',base_branch+'..'+head_branch]).decode('utf-8')
message += '\n\nPull request description:\n\n ' + body.replace('\n', '\n ') + '\n'
try:
subprocess.check_call([GIT,'merge','-q','--commit','--no-edit','--no-ff','-m',message.encode('utf-8'),head_branch])
except subprocess.CalledProcessError as e:
Expand Down
31 changes: 25 additions & 6 deletions contrib/verifybinaries/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

### This script attempts to download the signature file SHA256SUMS.asc from bitcoin.org
### This script attempts to download the signature file SHA256SUMS.asc from
### bitcoincore.org and bitcoin.org and compares them.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.. which makes no sense to do in our case but it's probably ok :)

### It first checks if the signature passes, and then downloads the files specified in
### the file, and checks if the hashes of these files match those that are specified
### in the signature file.
Expand All @@ -22,7 +23,9 @@ TMPFILE="hashes.tmp"

SIGNATUREFILENAME="SHA256SUMS.asc"
RCSUBDIR="test"
BASEDIR="https://bitcoin.org/bin/"
HOST1="https://bitcoincore.org"
HOST2="https://bitcoin.org"
BASEDIR="/bin/"
VERSIONPREFIX="bitcoin-core-"
RCVERSIONSTRING="rc"

Expand Down Expand Up @@ -81,7 +84,7 @@ else
fi

#first we fetch the file containing the signature
WGETOUT=$(wget -N "$BASEDIR$SIGNATUREFILENAME" 2>&1)
WGETOUT=$(wget -N "$HOST1$BASEDIR$SIGNATUREFILENAME" 2>&1)

#and then see if wget completed successfully
if [ $? -ne 0 ]; then
Expand All @@ -92,6 +95,22 @@ if [ $? -ne 0 ]; then
exit 2
fi

WGETOUT=$(wget -N -O "$SIGNATUREFILENAME.2" "$HOST2$BASEDIR$SIGNATUREFILENAME" 2>&1)
if [ $? -ne 0 ]; then
echo "bitcoin.org failed to provide signature file, but bitcoincore.org did?"
echo "wget output:"
echo "$WGETOUT"|sed 's/^/\t/g'
clean_up $SIGNATUREFILENAME
exit 3
fi

SIGFILEDIFFS="$(diff $SIGNATUREFILENAME $SIGNATUREFILENAME.2)"
if [ "$SIGFILEDIFFS" != "" ]; then
echo "bitcoin.org and bitcoincore.org signature files were not equal?"
clean_up $SIGNATUREFILENAME $SIGNATUREFILENAME.2
exit 4
fi

#then we check it
GPGOUT=$(gpg --yes --decrypt --output "$TMPFILE" "$SIGNATUREFILENAME" 2>&1)

Expand All @@ -111,7 +130,7 @@ if [ $RET -ne 0 ]; then

echo "gpg output:"
echo "$GPGOUT"|sed 's/^/\t/g'
clean_up $SIGNATUREFILENAME $TMPFILE
clean_up $SIGNATUREFILENAME $SIGNATUREFILENAME.2 $TMPFILE
exit "$RET"
fi

Expand All @@ -131,7 +150,7 @@ FILES=$(awk '{print $2}' "$TMPFILE")
for file in $FILES
do
echo "Downloading $file"
wget --quiet -N "$BASEDIR$file"
wget --quiet -N "$HOST1$BASEDIR$file"
done

#check hashes
Expand All @@ -149,7 +168,7 @@ fi

if [ -n "$2" ]; then
echo "Clean up the binaries"
clean_up $FILES $SIGNATUREFILENAME $TMPFILE
clean_up $FILES $SIGNATUREFILENAME $SIGNATUREFILENAME.2 $TMPFILE
else
echo "Keep the binaries in $WORKINGDIR"
clean_up $TMPFILE
Expand Down
28 changes: 16 additions & 12 deletions doc/REST-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ Only supports JSON as output format.
* headers : (numeric) the current number of headers we have validated
* bestblockhash : (string) the hash of the currently best block
* difficulty : (numeric) the current difficulty
* mediantime : (numeric) the median time of the 11 blocks before the most recent block on the blockchain
* verificationprogress : (numeric) estimate of verification progress [0..1]
* chainwork : (string) total amount of work in active chain, in hexadecimal
* pruned : (boolean) if the blocks are subject to pruning
* pruneheight : (numeric) heighest block available
* softforks : (array) status of softforks in progress
* bip9_softforks : (object) status of BIP9 softforks in progress

#### Query UTXO set
`GET /rest/getutxos/<checkmempool>/<txid>-<n>/<txid>-<n>/.../<txid>-<n>.<bin|hex|json>`
Expand All @@ -57,25 +59,25 @@ Example:
```
$ curl localhost:18332/rest/getutxos/checkmempool/b2cdfd7b89def827ff8af7cd9bff7627ff72e5e8b0f71210f92ea7a4000c5d75-0.json 2>/dev/null | json_pp
{
"chaintipHash" : "00000000fb01a7f3745a717f8caebee056c484e6e0bfe4a9591c235bb70506fb",
"chainHeight" : 325347,
"chaintipHash" : "00000000fb01a7f3745a717f8caebee056c484e6e0bfe4a9591c235bb70506fb",
"bitmap": "1",
"utxos" : [
{
"txvers" : 1
"height" : 2147483647,
"value" : 8.8687,
"scriptPubKey" : {
"addresses" : [
"mi7as51dvLJsizWnTMurtRmrP8hG2m1XvD"
],
"type" : "pubkeyhash",
"asm" : "OP_DUP OP_HASH160 1c7cebb529b86a04c683dfa87be49de35bcf589e OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a9141c7cebb529b86a04c683dfa87be49de35bcf589e88ac",
"reqSigs" : 1,
"asm" : "OP_DUP OP_HASH160 1c7cebb529b86a04c683dfa87be49de35bcf589e OP_EQUALVERIFY OP_CHECKSIG"
},
"value" : 8.8687,
"height" : 2147483647,
"txvers" : 1
"type" : "pubkeyhash",
"addresses" : [
"mi7as51dvLJsizWnTMurtRmrP8hG2m1XvD"
]
}
}
],
"bitmap" : "1"
]
}
```

Expand All @@ -87,6 +89,8 @@ Only supports JSON as output format.
* size : (numeric) the number of transactions in the TX mempool
* bytes : (numeric) size of the TX mempool in bytes
* usage : (numeric) total TX mempool memory usage
* maxmempool : (numeric) maximum memory usage for the mempool in bytes
* mempoolminfee : (numeric) minimum feerate (DASH per KB) for tx to be accepted

`GET /rest/mempool/contents.json`

Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.leveldb.include
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ leveldb_libmemenv_a_SOURCES += leveldb/helpers/memenv/memenv.h

leveldb_libleveldb_sse42_a_CPPFLAGS = $(leveldb_libleveldb_a_CPPFLAGS)
leveldb_libleveldb_sse42_a_CXXFLAGS = $(leveldb_libleveldb_a_CXXFLAGS)
if ENABLE_SSE42
if ENABLE_HWCRC32
leveldb_libleveldb_sse42_a_CPPFLAGS += -DLEVELDB_PLATFORM_POSIX_SSE
leveldb_libleveldb_sse42_a_CXXFLAGS += $(SSE42_CXXFLAGS)
endif
Expand Down
12 changes: 6 additions & 6 deletions src/base58.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ std::string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend)

std::string EncodeBase58(const std::vector<unsigned char>& vch)
{
return EncodeBase58(&vch[0], &vch[0] + vch.size());
return EncodeBase58(vch.data(), vch.data() + vch.size());
}

bool DecodeBase58(const std::string& str, std::vector<unsigned char>& vchRet)
Expand Down Expand Up @@ -160,7 +160,7 @@ void CBase58Data::SetData(const std::vector<unsigned char>& vchVersionIn, const
vchVersion = vchVersionIn;
vchData.resize(nSize);
if (!vchData.empty())
memcpy(&vchData[0], pdata, nSize);
memcpy(vchData.data(), pdata, nSize);
}

void CBase58Data::SetData(const std::vector<unsigned char>& vchVersionIn, const unsigned char* pbegin, const unsigned char* pend)
Expand All @@ -180,8 +180,8 @@ bool CBase58Data::SetString(const char* psz, unsigned int nVersionBytes)
vchVersion.assign(vchTemp.begin(), vchTemp.begin() + nVersionBytes);
vchData.resize(vchTemp.size() - nVersionBytes);
if (!vchData.empty())
memcpy(&vchData[0], &vchTemp[nVersionBytes], vchData.size());
memory_cleanse(&vchTemp[0], vchTemp.size());
memcpy(vchData.data(), vchTemp.data() + nVersionBytes, vchData.size());
memory_cleanse(vchTemp.data(), vchTemp.size());
return true;
}

Expand Down Expand Up @@ -262,7 +262,7 @@ CTxDestination CBitcoinAddress::Get() const
if (!IsValid())
return CNoDestination();
uint160 id;
memcpy(&id, &vchData[0], 20);
memcpy(&id, vchData.data(), 20);
if (vchVersion == Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS))
return CKeyID(id);
else if (vchVersion == Params().Base58Prefix(CChainParams::SCRIPT_ADDRESS))
Expand Down Expand Up @@ -293,7 +293,7 @@ bool CBitcoinAddress::GetKeyID(CKeyID& keyID) const
if (!IsValid() || vchVersion != Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS))
return false;
uint160 id;
memcpy(&id, &vchData[0], 20);
memcpy(&id, vchData.data(), 20);
keyID = CKeyID(id);
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/base58.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ template<typename K, int Size, CChainParams::Base58Type Type> class CBitcoinExtK
K ret;
if (vchData.size() == Size) {
// If base58 encoded data does not hold an ext key, return a !IsValid() key
ret.Decode(&vchData[0]);
ret.Decode(vchData.data());
}
return ret;
}
Expand Down
27 changes: 15 additions & 12 deletions src/bench/base58.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,37 @@
#include "validation.h"
#include "base58.h"

#include <array>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verify_script.cpp is not in our repo. Is yet another earlier PR missing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added in bitcoin#8873 @codablock backported most of this pr so I assume there was a reason he dropped this file. I don't see any mention of such in #1849 however. File seems (maybe) witness/segwit dependant

#include <vector>
#include <string>


static void Base58Encode(benchmark::State& state)
{
unsigned char buff[32] = {
17, 79, 8, 99, 150, 189, 208, 162, 22, 23, 203, 163, 36, 58, 147,
227, 139, 2, 215, 100, 91, 38, 11, 141, 253, 40, 117, 21, 16, 90,
200, 24
static const std::array<unsigned char, 32> buff = {
{
17, 79, 8, 99, 150, 189, 208, 162, 22, 23, 203, 163, 36, 58, 147,
227, 139, 2, 215, 100, 91, 38, 11, 141, 253, 40, 117, 21, 16, 90,
200, 24
}
};
unsigned char* b = buff;
while (state.KeepRunning()) {
EncodeBase58(b, b + 32);
EncodeBase58(buff.begin(), buff.end());
}
}


static void Base58CheckEncode(benchmark::State& state)
{
unsigned char buff[32] = {
17, 79, 8, 99, 150, 189, 208, 162, 22, 23, 203, 163, 36, 58, 147,
227, 139, 2, 215, 100, 91, 38, 11, 141, 253, 40, 117, 21, 16, 90,
200, 24
static const std::array<unsigned char, 32> buff = {
{
17, 79, 8, 99, 150, 189, 208, 162, 22, 23, 203, 163, 36, 58, 147,
227, 139, 2, 215, 100, 91, 38, 11, 141, 253, 40, 117, 21, 16, 90,
200, 24
}
};
unsigned char* b = buff;
std::vector<unsigned char> vch;
vch.assign(b, b + 32);
vch.assign(buff.begin(), buff.end());
while (state.KeepRunning()) {
EncodeBase58Check(vch);
}
Expand Down
8 changes: 4 additions & 4 deletions src/compressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,30 +93,30 @@ bool CScriptCompressor::Decompress(unsigned int nSize, const std::vector<unsigne
script[0] = OP_DUP;
script[1] = OP_HASH160;
script[2] = 20;
memcpy(&script[3], &in[0], 20);
memcpy(&script[3], in.data(), 20);
script[23] = OP_EQUALVERIFY;
script[24] = OP_CHECKSIG;
return true;
case 0x01:
script.resize(23);
script[0] = OP_HASH160;
script[1] = 20;
memcpy(&script[2], &in[0], 20);
memcpy(&script[2], in.data(), 20);
script[22] = OP_EQUAL;
return true;
case 0x02:
case 0x03:
script.resize(35);
script[0] = 33;
script[1] = nSize;
memcpy(&script[2], &in[0], 32);
memcpy(&script[2], in.data(), 32);
script[34] = OP_CHECKSIG;
return true;
case 0x04:
case 0x05:
unsigned char vch[33] = {};
vch[0] = nSize - 2;
memcpy(&vch[1], &in[0], 32);
memcpy(&vch[1], in.data(), 32);
CPubKey pubkey(&vch[0], &vch[33]);
if (!pubkey.Decompress())
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/core_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CScript ParseScript(const std::string& s)

if (mapOpNames.empty())
{
for (int op = 0; op <= OP_NOP10; op++)
for (unsigned int op = 0; op <= OP_NOP10; op++)
{
// Allow OP_RESERVED to get into mapOpNames
if (op < OP_NOP && op != OP_RESERVED)
Expand Down
10 changes: 8 additions & 2 deletions src/dash-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,14 @@ static void http_error_cb(enum evhttp_request_error err, void *ctx)

UniValue CallRPC(const std::string& strMethod, const UniValue& params)
{
std::string host = gArgs.GetArg("-rpcconnect", DEFAULT_RPCCONNECT);
int port = gArgs.GetArg("-rpcport", BaseParams().RPCPort());
std::string host;
// In preference order, we choose the following for the port:
// 1. -rpcport
// 2. port in -rpcconnect (ie following : in ipv4 or ]: in ipv6)
// 3. default port for chain
int port = BaseParams().RPCPort();
SplitHostPort(gArgs.GetArg("-rpcconnect", DEFAULT_RPCCONNECT), port, host);
port = gArgs.GetArg("-rpcport", port);

// Obtain event base
raii_event_base base = obtain_event_base();
Expand Down
Loading