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
3 changes: 2 additions & 1 deletion contrib/debian/dash-qt.desktop
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Name=Dash Core
Comment=Dash P2P Cryptocurrency
Comment[de]=Verbinde mit dem Dash peer-to-peer Netzwerk
Expand All @@ -11,3 +11,4 @@ Type=Application
Icon=dash128
MimeType=x-scheme-handler/dash;
Categories=Office;Finance;
StartupWMClass=Dash-qt
2 changes: 1 addition & 1 deletion contrib/devtools/gen-manpages.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)}
SRCDIR=${SRCDIR:-$TOPDIR/src}
Expand Down
2 changes: 1 addition & 1 deletion contrib/macdeploy/detached-sig-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ grep CodeResources < "${TEMPLIST}" | while read i; do
RESOURCE="${TEMPDIR}/${OUTROOT}/${TARGETFILE}"
DIRNAME="`dirname "${RESOURCE}"`"
mkdir -p "${DIRNAME}"
echo "Adding resource for: "${TARGETFILE}""
echo "Adding resource for: \"${TARGETFILE}\""
cp "${i}" "${RESOURCE}"
done

Expand Down
2 changes: 1 addition & 1 deletion contrib/tidy_datadir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

if [ -d "$1" ]; then
cd "$1"
cd "$1" || exit 1
else
echo "Usage: $0 <datadir>" >&2
echo "Removes obsolete Dash database files" >&2
Expand Down
5 changes: 2 additions & 3 deletions contrib/verify-commits/verify-commits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ VERIFIED_ROOT=$(cat "${DIR}/trusted-git-root")
VERIFIED_SHA512_ROOT=$(cat "${DIR}/trusted-sha512-root-commit")
REVSIG_ALLOWED=$(cat "${DIR}/allow-revsig-commits")

HAVE_FAILED=false

HAVE_GNU_SHA512=1
[ ! -x "$(which sha512sum)" ] && HAVE_GNU_SHA512=0

Expand All @@ -35,10 +33,11 @@ fi

NO_SHA1=1
PREV_COMMIT=""
INITIAL_COMMIT="${CURRENT_COMMIT}"
Comment thread
UdjinM6 marked this conversation as resolved.
Outdated

while true; do
if [ "$CURRENT_COMMIT" = $VERIFIED_ROOT ]; then
echo "There is a valid path from "$CURRENT_COMMIT" to $VERIFIED_ROOT where all commits are signed!"
echo "There is a valid path from \"$INITIAL_COMMIT\" to $VERIFIED_ROOT where all commits are signed!"
exit 0
fi

Expand Down
6 changes: 2 additions & 4 deletions contrib/verifybinaries/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [ ! -d "$WORKINGDIR" ]; then
mkdir "$WORKINGDIR"
fi

cd "$WORKINGDIR"
cd "$WORKINGDIR" || exit 1

#test if a version number has been passed as an argument
if [ -n "$1" ]; then
Expand Down Expand Up @@ -76,8 +76,6 @@ if [ -n "$1" ]; then
BASEDIR="$BASEDIR$RCSUBDIR.$RCVERSION/"
fi
fi

SIGNATUREFILE="$BASEDIR$SIGNATUREFILENAME"
else
echo "Error: need to specify a version on the command line"
exit 2
Expand All @@ -89,7 +87,7 @@ WGETOUT=$(wget -N "$HOST1$BASEDIR$SIGNATUREFILENAME" 2>&1)
#and then see if wget completed successfully
if [ $? -ne 0 ]; then
echo "Error: couldn't fetch signature file. Have you specified the version number in the following format?"
echo "[$VERSIONPREFIX]<version>-[$RCVERSIONSTRING[0-9]] (example: "$VERSIONPREFIX"0.10.4-"$RCVERSIONSTRING"1)"
echo "[$VERSIONPREFIX]<version>-[$RCVERSIONSTRING[0-9]] (example: ${VERSIONPREFIX}0.10.4-${RCVERSIONSTRING}1)"
echo "wget output:"
echo "$WGETOUT"|sed 's/^/\t/g'
exit 2
Expand Down
1 change: 1 addition & 0 deletions depends/packages/zeromq.mk
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ define $(package)_stage_cmds
endef

define $(package)_postprocess_cmds
sed -i.old "s/ -lstdc++//" lib/pkgconfig/libzmq.pc && \
rm -rf bin share
endef
2 changes: 1 addition & 1 deletion share/genbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

if [ $# -gt 1 ]; then
cd "$2"
cd "$2" || exit 1
fi
if [ $# -gt 0 ]; then
FILE="$1"
Expand Down
1 change: 0 additions & 1 deletion src/addrdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <addrman.h>
#include <chainparams.h>
#include <clientversion.h>
#include <fs.h>
#include <hash.h>
#include <random.h>
#include <streams.h>
Expand Down
6 changes: 3 additions & 3 deletions src/addrman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,9 @@ int CAddrMan::Check_()
if (vRandom.size() != (size_t)(nTried + nNew))
return -7;

for (std::map<int, CAddrInfo>::iterator it = mapInfo.begin(); it != mapInfo.end(); it++) {
int n = (*it).first;
CAddrInfo& info = (*it).second;
for (const auto& entry : mapInfo) {
int n = entry.first;
const CAddrInfo& info = entry.second;
if (info.fInTried) {
if (!info.nLastSuccess)
return -1;
Expand Down
10 changes: 5 additions & 5 deletions src/addrman.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,18 +319,18 @@ class CAddrMan
s << nUBuckets;
std::map<int, int> mapUnkIds;
int nIds = 0;
for (std::map<int, CAddrInfo>::const_iterator it = mapInfo.begin(); it != mapInfo.end(); it++) {
mapUnkIds[(*it).first] = nIds;
const CAddrInfo &info = (*it).second;
for (const auto& entry : mapInfo) {
mapUnkIds[entry.first] = nIds;
const CAddrInfo &info = entry.second;
if (info.nRefCount) {
assert(nIds != nNew); // this means nNew was wrong, oh ow
s << info;
nIds++;
}
}
nIds = 0;
for (std::map<int, CAddrInfo>::const_iterator it = mapInfo.begin(); it != mapInfo.end(); it++) {
const CAddrInfo &info = (*it).second;
for (const auto& entry : mapInfo) {
const CAddrInfo &info = entry.second;
if (info.fInTried) {
assert(nIds != nTried); // this means nTried was wrong, oh ow
s << info;
Expand Down
1 change: 0 additions & 1 deletion src/checkpoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <chainparams.h>
#include <reverse_iterator.h>
#include <validation.h>
#include <uint256.h>

#include <stdint.h>

Expand Down
1 change: 0 additions & 1 deletion src/clientversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <tinyformat.h>

#include <string>

/**
* Name of client reported in the 'version' message. Report the same name
Expand Down
3 changes: 0 additions & 3 deletions src/coins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
#include <coins.h>

#include <consensus/consensus.h>
#include <memusage.h>
#include <random.h>

#include <assert.h>

bool CCoinsView::GetCoin(const COutPoint &outpoint, Coin &coin) const { return false; }
uint256 CCoinsView::GetBestBlock() const { return uint256(); }
std::vector<uint256> CCoinsView::GetHeadBlocks() const { return std::vector<uint256>(); }
Expand Down
2 changes: 0 additions & 2 deletions src/dbwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

#include <dbwrapper.h>

#include <fs.h>
#include <util.h>
#include <random.h>

#include <leveldb/cache.h>
Expand Down
19 changes: 3 additions & 16 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1484,23 +1484,10 @@ bool AppInitParameterInteraction()

static bool LockDataDirectory(bool probeOnly)
{
std::string strDataDir = GetDataDir().string();

// Make sure only a single Dash Core process is using the data directory.
fs::path pathLockFile = GetDataDir() / ".lock";
FILE* file = fsbridge::fopen(pathLockFile, "a"); // empty lock file; created if it doesn't exist.
if (file) fclose(file);

try {
static boost::interprocess::file_lock lock(pathLockFile.string().c_str());
if (!lock.try_lock()) {
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. %s is probably already running."), strDataDir, _(PACKAGE_NAME)));
}
if (probeOnly) {
lock.unlock();
}
} catch(const boost::interprocess::interprocess_exception& e) {
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. %s is probably already running.") + " %s.", strDataDir, _(PACKAGE_NAME), e.what()));
fs::path datadir = GetDataDir();
if (!LockDirectory(datadir, ".lock", probeOnly)) {
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. %s is probably already running."), datadir.string(), _(PACKAGE_NAME)));
}
return true;
}
Expand Down
1 change: 0 additions & 1 deletion src/key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <arith_uint256.h>
#include <crypto/common.h>
#include <crypto/hmac_sha512.h>
#include <pubkey.h>
#include <random.h>

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

#include <keystore.h>

#include <key.h>
#include <pubkey.h>
#include <util.h>

bool CKeyStore::AddKey(const CKey &key) {
Expand Down Expand Up @@ -79,6 +77,16 @@ bool CBasicKeyStore::HaveCScript(const CScriptID& hash) const
return mapScripts.count(hash) > 0;
}

std::set<CScriptID> CBasicKeyStore::GetCScripts() const
{
LOCK(cs_KeyStore);
std::set<CScriptID> set_script;
for (const auto& mi : mapScripts) {
set_script.insert(mi.first);
}
return set_script;
}

bool CBasicKeyStore::GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const
{
LOCK(cs_KeyStore);
Expand Down
2 changes: 2 additions & 0 deletions src/keystore.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class CKeyStore
//! Support for BIP 0013 : see https://github.com/bitcoin/bips/blob/master/bip-0013.mediawiki
virtual bool AddCScript(const CScript& redeemScript) =0;
virtual bool HaveCScript(const CScriptID &hash) const =0;
virtual std::set<CScriptID> GetCScripts() const =0;
virtual bool GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const =0;

//! Support for Watch-only addresses
Expand Down Expand Up @@ -70,6 +71,7 @@ class CBasicKeyStore : public CKeyStore
bool GetKey(const CKeyID &address, CKey &keyOut) const override;
bool AddCScript(const CScript& redeemScript) override;
bool HaveCScript(const CScriptID &hash) const override;
std::set<CScriptID> GetCScripts() const override;
bool GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const override;

bool AddWatchOnly(const CScript &dest) override;
Expand Down
1 change: 0 additions & 1 deletion src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <primitives/transaction.h>
#include <script/standard.h>
#include <timedata.h>
#include <txmempool.h>
#include <util.h>
#include <utilmoneystr.h>
#include <masternode/masternode-payments.h>
Expand Down
10 changes: 4 additions & 6 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@
#include <net.h>
#include <netmessagemaker.h>

#include <addrman.h>
#include <chainparams.h>
#include <clientversion.h>
#include <consensus/consensus.h>
#include <crypto/common.h>
#include <crypto/sha256.h>
#include <hash.h>
#include <primitives/transaction.h>
#include <netbase.h>
#include <scheduler.h>
Expand Down Expand Up @@ -121,13 +119,13 @@ bool GetLocal(CService& addr, const CNetAddr *paddrPeer)
int nBestReachability = -1;
{
LOCK(cs_mapLocalHost);
for (std::map<CNetAddr, LocalServiceInfo>::iterator it = mapLocalHost.begin(); it != mapLocalHost.end(); it++)
for (const auto& entry : mapLocalHost)
{
int nScore = (*it).second.nScore;
int nReachability = (*it).first.GetReachabilityFrom(paddrPeer);
int nScore = entry.second.nScore;
int nReachability = entry.first.GetReachabilityFrom(paddrPeer);
if (nReachability > nBestReachability || (nReachability == nBestReachability && nScore > nBestScore))
{
addr = CService((*it).first, (*it).second.nPort);
addr = CService(entry.first, entry.second.nPort);
nBestReachability = nReachability;
nBestScore = nScore;
}
Expand Down
2 changes: 0 additions & 2 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <init.h>
#include <validation.h>
#include <merkleblock.h>
#include <net.h>
#include <netmessagemaker.h>
#include <netbase.h>
#include <policy/fees.h>
Expand All @@ -31,7 +30,6 @@
#include <util.h>
#include <utilmoneystr.h>
#include <utilstrencodings.h>
#include <validationinterface.h>

#include <spork.h>
#include <governance/governance.h>
Expand Down
4 changes: 0 additions & 4 deletions src/netaddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifdef HAVE_CONFIG_H
#include <config/dash-config.h>
#endif

#include <netaddress.h>
#include <netbase.h>
#include <hash.h>
Expand Down
4 changes: 0 additions & 4 deletions src/netbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifdef HAVE_CONFIG_H
#include <config/dash-config.h>
#endif

#include <netbase.h>

#include <hash.h>
Expand Down
1 change: 0 additions & 1 deletion src/policy/fees.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <policy/fees.h>
#include <policy/policy.h>

#include <amount.h>
#include <clientversion.h>
#include <primitives/transaction.h>
#include <streams.h>
Expand Down
6 changes: 3 additions & 3 deletions src/qt/bantablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ class BanTablePriv
#if QT_VERSION >= 0x040700
cachedBanlist.reserve(banMap.size());
#endif
for (banmap_t::iterator it = banMap.begin(); it != banMap.end(); it++)
for (const auto& entry : banMap)
{
CCombinedBan banEntry;
banEntry.subnet = (*it).first;
banEntry.banEntry = (*it).second;
banEntry.subnet = entry.first;
banEntry.banEntry = entry.second;
cachedBanlist.append(banEntry);
}

Expand Down
4 changes: 0 additions & 4 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#if defined(HAVE_CONFIG_H)
#include <config/dash-config.h>
#endif

#include <qt/bitcoingui.h>

#include <qt/bitcoinunits.h>
Expand Down
2 changes: 0 additions & 2 deletions src/qt/coincontroldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@
#include <QFlags>
#include <QIcon>
#include <QSettings>
#include <QString>
#include <QTreeWidget>
#include <QTreeWidgetItem>

QList<CAmount> CoinControlDialog::payAmounts;
CCoinControl* CoinControlDialog::coinControl = new CCoinControl();
Expand Down
1 change: 0 additions & 1 deletion src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <qt/qvalidatedlineedit.h>
#include <qt/walletmodel.h>

#include <fs.h>
#include <primitives/transaction.h>
#include <init.h>
#include <policy/policy.h>
Expand Down
1 change: 0 additions & 1 deletion src/qt/notificator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <QApplication>
#include <QByteArray>
#include <QIcon>
#include <QImageWriter>
#include <QMessageBox>
#include <QMetaType>
Expand Down
Loading