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
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ case $host in
AC_MSG_ERROR("windres not found")
fi

CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB"
CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -D_WIN32_WINNT=0x0601"
if test "x$CXXFLAGS_overridden" = "xno"; then
CXXFLAGS="$CXXFLAGS -w"
fi
Expand Down
3 changes: 2 additions & 1 deletion contrib/devtools/gen-manpages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ MANDIR=${MANDIR:-$TOPDIR/doc/man}
BITCOIND=${BITCOIND:-$BINDIR/dashd}
BITCOINCLI=${BITCOINCLI:-$BINDIR/dash-cli}
BITCOINTX=${BITCOINTX:-$BINDIR/dash-tx}
WALLET_TOOL=${WALLET_TOOL:-$BINDIR/dash-wallet}
BITCOINQT=${BITCOINQT:-$BINDIR/qt/dash-qt}

[ ! -x $BITCOIND ] && echo "$BITCOIND not found or not executable." && exit 1
Expand All @@ -23,7 +24,7 @@ read -r -a BTCVER <<< "$($BITCOINCLI --version | head -n1 | awk -F'[ -]' '{ prin
echo "[COPYRIGHT]" > footer.h2m
$BITCOIND --version | sed -n '1!p' >> footer.h2m

for cmd in $BITCOIND $BITCOINCLI $BITCOINTX $BITCOINQT; do
for cmd in $BITCOIND $BITCOINCLI $BITCOINTX $WALLET_TOOL $BITCOINQT; do
cmdname="${cmd##*/}"
help2man -N --version-string=${BTCVER[0]} --include=footer.h2m -o ${MANDIR}/${cmdname}.1 ${cmd}
sed -i "s/\\\-${BTCVER[1]}//g" ${MANDIR}/${cmdname}.1
Expand Down
2 changes: 1 addition & 1 deletion doc/man/dash-tx.1
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ sign=SIGHASH\-FLAGS
.IP
Add zero or more signatures to transaction. This command requires JSON
registers:prevtxs=JSON object, privatekeys=JSON object. See
signrawtransaction docs for format of sighash flags, JSON
signrawtransactionwithkey docs for format of sighash flags, JSON
objects.
.PP
Register Commands:
Expand Down
68 changes: 68 additions & 0 deletions doc/man/dash-wallet.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
.TH DASH-WALLET "1" "February 2019" "dash-wallet v0.17.99.0" "User Commands"
.SH NAME
dash-wallet \- manual page for dash-wallet v0.17.99.0
.SH DESCRIPTION
DASH Core dash\-wallet version v0.17.99.0
.PP
wallet\-tool is an offline tool for creating and interacting with Dash Core wallet files.
By default wallet\-tool will act on wallets in the default mainnet wallet directory in the datadir.
To change the target wallet, use the \fB\-datadir\fR, \fB\-wallet\fR and \fB\-testnet\fR/\-regtest arguments.
.SS "Usage:"
.IP
dash\-wallet [options] <command>
.SH OPTIONS
.HP
\-?
.IP
This help message
.HP
\fB\-datadir=\fR<dir>
.IP
Specify data directory
.HP
\fB\-wallet=\fR<wallet\-name>
.IP
Specify wallet name
.PP
Debugging/Testing options:
.HP
\fB\-debug=\fR<category>
.IP
Output debugging information (default: 0).
.HP
\fB\-printtoconsole\fR
.IP
Send trace/debug info to console (default: 1 when no \fB\-debug\fR is true, 0
otherwise.
.PP
Chain selection options:
.HP
\fB\-testnet\fR
.IP
Use the test chain
.PP
Commands:
.IP
create
.IP
Create new wallet file
.IP
info
.IP
Get wallet info
.SH COPYRIGHT
Copyright (C) 2014-2021 The Dash Core developers
Copyright (C) 2009-2019 The Bitcoin Core developers

Please contribute if you find Bitcoin Core useful. Visit
<https://bitcoincore.org> for further information about the software.
The source code is available from <https://github.com/bitcoin/bitcoin>.

This is experimental software.
Distributed under the MIT software license, see the accompanying file COPYING
or <https://opensource.org/licenses/MIT>

This product includes software developed by the OpenSSL Project for use in the
OpenSSL Toolkit <https://www.openssl.org> and cryptographic software written by
Eric Young and UPnP software written by Thomas Bernard.
4 changes: 2 additions & 2 deletions doc/man/dashd.1
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Specify data directory
.HP
\fB\-dbcache=\fR<n>
.IP
Set database cache size in megabytes (4 to 16384, default: 300)
Set database cache size in MiB (4 to 16384, default: 300)
.HP
\fB\-debuglogfile=\fR<file>
.IP
Expand Down Expand Up @@ -741,7 +741,7 @@ relaying, mining and transaction creation (default: 0.00001)
\fB\-whitelistforcerelay\fR
.IP
Force relay of transactions from whitelisted peers even if they violate
local relay policy (default: 1)
local relay policy (default: 0)
.HP
\fB\-whitelistrelay\fR
.IP
Expand Down
4 changes: 0 additions & 4 deletions src/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
#endif

#ifdef WIN32
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0501
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
Expand Down
11 changes: 1 addition & 10 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1221,16 +1221,7 @@ bool AppInitBasicSetup()
#endif
#ifdef WIN32
// Enable Data Execution Prevention (DEP)
// Minimum supported OS versions: WinXP SP3, WinVista >= SP1, Win Server 2008
// A failure is non-critical and needs no further attention!
#ifndef PROCESS_DEP_ENABLE
// We define this here, because GCCs winbase.h limits this to _WIN32_WINNT >= 0x0601 (Windows 7),
// which is not correct. Can be removed, when GCCs winbase.h is fixed!
#define PROCESS_DEP_ENABLE 0x00000001
#endif
typedef BOOL (WINAPI *PSETPROCDEPPOL)(DWORD);
PSETPROCDEPPOL setProcDEPPol = (PSETPROCDEPPOL)GetProcAddress(GetModuleHandleA("Kernel32.dll"), "SetProcessDEPPolicy");
if (setProcDEPPol != nullptr) setProcDEPPol(PROCESS_DEP_ENABLE);
SetProcessDEPPolicy(PROCESS_DEP_ENABLE);
#endif

if (!SetupNetworking())
Expand Down
19 changes: 7 additions & 12 deletions src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
#include <chain.h>
#include <chainparams.h>
#include <consensus/consensus.h>
#include <consensus/tx_verify.h>
#include <consensus/merkle.h>
#include <consensus/tx_verify.h>
#include <consensus/validation.h>
#include <policy/feerate.h>
#include <policy/policy.h>
#include <pow.h>
#include <primitives/transaction.h>
#include <timedata.h>
#include <util/system.h>
#include <util/moneystr.h>
#include <util/system.h>
#include <util/validation.h>

#include <evo/specialtx.h>
Expand All @@ -33,14 +33,6 @@
#include <algorithm>
#include <utility>

// Unconfirmed transactions in the memory pool often depend on other
// transactions in the memory pool. When we select transactions from the
// pool, we select by highest fee rate of a transaction combined with all
// its ancestors.

uint64_t nLastBlockTx = 0;
uint64_t nLastBlockSize = 0;

int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev)
{
int64_t nOldTime = pblock->nTime;
Expand Down Expand Up @@ -100,6 +92,9 @@ void BlockAssembler::resetBlock()
nFees = 0;
}

Optional<int64_t> BlockAssembler::m_last_block_num_txs{nullopt};
Optional<int64_t> BlockAssembler::m_last_block_size{nullopt};

std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& scriptPubKeyIn)
{
int64_t nTimeStart = GetTimeMicros();
Expand Down Expand Up @@ -160,8 +155,8 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc

int64_t nTime1 = GetTimeMicros();

nLastBlockTx = nBlockTx;
nLastBlockSize = nBlockSize;
m_last_block_num_txs = nBlockTx;
m_last_block_size = nBlockSize;
LogPrintf("CreateNewBlock(): total size %u txs: %u fees: %ld sigops %d\n", nBlockSize, nBlockTx, nFees, nBlockSigOps);

// Create coinbase transaction.
Expand Down
9 changes: 7 additions & 2 deletions src/miner.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2015 The Bitcoin Core developers
// Copyright (c) 2009-2018 The Bitcoin Core developers
Copy link
Member

@PastaPastaPasta PastaPastaPasta Mar 5, 2022

Choose a reason for hiding this comment

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

nit should've bumped to 2019

// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef BITCOIN_MINER_H
#define BITCOIN_MINER_H

#include <optional.h>
#include <primitives/block.h>
#include <txmempool.h>
#include <validation.h>

#include <stdint.h>
#include <memory>
#include <stdint.h>

#include <boost/multi_index_container.hpp>
#include <boost/multi_index/ordered_index.hpp>

Expand Down Expand Up @@ -159,6 +161,9 @@ class BlockAssembler
/** Construct a new block template with coinbase to scriptPubKeyIn */
std::unique_ptr<CBlockTemplate> CreateNewBlock(const CScript& scriptPubKeyIn);

static Optional<int64_t> m_last_block_num_txs;
static Optional<int64_t> m_last_block_size;

private:
// utility functions
/** Clear the block's state and prepare for assembling a new block */
Expand Down
11 changes: 0 additions & 11 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,6 @@ static constexpr int DNSSEEDS_TO_QUERY_AT_ONCE = 3;
#define MSG_DONTWAIT 0
#endif

// Fix for ancient MinGW versions, that don't have defined these in ws2tcpip.h.
// Todo: Can be removed when our pull-tester is upgraded to a modern MinGW version.
#ifdef WIN32
#ifndef PROTECTION_LEVEL_UNRESTRICTED
#define PROTECTION_LEVEL_UNRESTRICTED 10
#endif
#ifndef IPV6_PROTECTION_LEVEL
#define IPV6_PROTECTION_LEVEL 23
#endif
#endif

/** Used to pass flags to the Bind() function */
enum BindFlags {
BF_NONE = 0,
Expand Down
4 changes: 0 additions & 4 deletions src/netbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,13 @@ bool static LookupIntern(const char *pszName, std::vector<CNetAddr>& vIP, unsign
aiHint.ai_protocol = IPPROTO_TCP;
// We don't care which address family (IPv4 or IPv6) is returned
aiHint.ai_family = AF_UNSPEC;
#ifdef WIN32
aiHint.ai_flags = fAllowLookup ? 0 : AI_NUMERICHOST;
#else
// If we allow lookups of hostnames, use the AI_ADDRCONFIG flag to only
// return addresses whose family we have an address configured for.
//
// If we don't allow lookups, then use the AI_NUMERICHOST flag for
// getaddrinfo to only decode numerical network addresses and suppress
// hostname lookups.
aiHint.ai_flags = fAllowLookup ? AI_ADDRCONFIG : AI_NUMERICHOST;
#endif
struct addrinfo *aiRes = nullptr;
int nErr = getaddrinfo(pszName, nullptr, &aiHint, &aiRes);
if (nErr)
Expand Down
4 changes: 0 additions & 4 deletions src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
#include <util/system.h>

#ifdef WIN32
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0501
#ifdef _WIN32_IE
#undef _WIN32_IE
#endif
Expand Down
28 changes: 14 additions & 14 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,36 +199,36 @@ static UniValue generatetoaddress(const JSONRPCRequest& request)

static UniValue getmininginfo(const JSONRPCRequest& request)
{
if (request.fHelp || request.params.size() != 0)
if (request.fHelp || request.params.size() != 0) {
throw std::runtime_error(
RPCHelpMan{"getmininginfo",
"\nReturns a json object containing mining-related information.",
{},
RPCResult{
"{\n"
" \"blocks\": nnn, (numeric) The current block\n"
" \"currentblocksize\": nnn, (numeric) The last block size\n"
" \"currentblocktx\": nnn, (numeric) The last block transaction\n"
" \"difficulty\": xxx.xxxxx (numeric) The current difficulty\n"
" \"networkhashps\": nnn, (numeric) The network hashes per second\n"
" \"pooledtx\": n (numeric) The size of the mempool\n"
" \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n"
" \"warnings\": \"...\" (string) any network and blockchain warnings\n"
"}\n"
"{\n"
" \"blocks\": nnn, (numeric) The current block\n"
" \"currentblocksize\": nnn, (numeric, optional) The block size of the last assembled block (only present if a block was ever assembled)\n"
" \"currentblocktx\": nnn, (numeric, optional) The number of block transactions of the last assembled block (only present if a block was ever assembled)\n"
" \"difficulty\": xxx.xxxxx (numeric) The current difficulty\n"
" \"networkhashps\": nnn, (numeric) The network hashes per second\n"
" \"pooledtx\": n (numeric) The size of the mempool\n"
" \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n"
" \"warnings\": \"...\" (string) any network and blockchain warnings\n"
"}\n"
},
RPCExamples{
HelpExampleCli("getmininginfo", "")
+ HelpExampleRpc("getmininginfo", "")
},
}.ToString());

}

LOCK(cs_main);

UniValue obj(UniValue::VOBJ);
obj.pushKV("blocks", (int)::ChainActive().Height());
obj.pushKV("currentblocksize", (uint64_t)nLastBlockSize);
obj.pushKV("currentblocktx", (uint64_t)nLastBlockTx);
if (BlockAssembler::m_last_block_size) obj.pushKV("currentblocksize", *BlockAssembler::m_last_block_size);
if (BlockAssembler::m_last_block_num_txs) obj.pushKV("currentblocktx", *BlockAssembler::m_last_block_num_txs);
obj.pushKV("difficulty", (double)GetDifficulty(::ChainActive().Tip()));
obj.pushKV("networkhashps", getnetworkhashps(request));
obj.pushKV("pooledtx", (uint64_t)mempool.size());
Expand Down
8 changes: 6 additions & 2 deletions src/rpc/rawtransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,17 @@ static UniValue getrawtransaction(const JSONRPCRequest& request)
{
if (request.fHelp || request.params.size() < 1 || request.params.size() > 3)
throw std::runtime_error(
RPCHelpMan{"getrawtransaction",
RPCHelpMan{
"getrawtransaction",
"\nReturn the raw transaction data.\n"

"\nBy default this function only works for mempool transactions. When called with a blockhash\n"
"argument, getrawtransaction will return the transaction if the specified block is available and\n"
"the transaction is found in that block. When called without a blockhash argument, getrawtransaction\n"
"will return the transaction if it is in the mempool, or if -txindex is enabled and the transaction\n"
"is in a block in the blockchain.\n"
"\nReturn the raw transaction data.\n"
"\nHint: use getmempoolentry to fetch a specific transaction from the mempool.\n"
"Or use gettransaction for wallet transactions.\n"
"\nIf verbose is 'true', returns an Object with information about 'txid'.\n"
"If verbose is 'false' or omitted, returns a string that is serialized, hex-encoded data for 'txid'.\n",
{
Expand Down
4 changes: 0 additions & 4 deletions src/support/lockedpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
#endif

#ifdef WIN32
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0501
#define WIN32_LEAN_AND_MEAN 1
#ifndef NOMINMAX
#define NOMINMAX
Expand Down
5 changes: 0 additions & 5 deletions src/util/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@
#pragma warning(disable:4717)
#endif

#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0501

#ifdef _WIN32_IE
#undef _WIN32_IE
#endif
Expand Down
4 changes: 1 addition & 3 deletions src/validation.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include <coins.h>
#include <crypto/common.h> // for ReadLE64
#include <fs.h>
#include <protocol.h> // For CMessageHeader::MessageStartChars
#include <policy/feerate.h>
#include <protocol.h> // For CMessageHeader::MessageStartChars
#include <script/script_error.h>
#include <sync.h>
#include <txdb.h>
Expand Down Expand Up @@ -123,8 +123,6 @@ extern CBlockPolicyEstimator feeEstimator;
extern CTxMemPool mempool;
typedef std::unordered_map<uint256, CBlockIndex*, BlockHasher> BlockMap;
typedef std::unordered_multimap<uint256, CBlockIndex*, BlockHasher> PrevBlockMap;
extern uint64_t nLastBlockTx;
extern uint64_t nLastBlockSize;
extern Mutex g_best_block_mutex;
extern std::condition_variable g_best_block_cv;
extern uint256 g_best_block;
Expand Down
Loading