Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6fe5c69
tests: fixes mininode's P2PConnection sending messages on closing tra…
marcohextor Jul 19, 2018
eb26c2e
depends: disable Werror for zmqlib release, causes ndk build to break
Jul 17, 2018
c8a7b10
[wallet] [rpc] Fix importaddress help text
jnewbery Apr 25, 2018
e4cfbaa
wallet: Add error handling. Check return value of ParseUInt32(...) in…
practicalswift Jul 19, 2018
a9bedca
wallet: Add tests for ParseHDKeypath(...)
practicalswift Jul 19, 2018
9887710
Add facility to store wallet flags (64 bits)
jonasschnelli Feb 16, 2017
de45beb
Add option to disable private keys during internal wallet creation
jonasschnelli May 5, 2017
d830dfb
[Qt] Disable creating receive addresses when private keys are disabled
jonasschnelli Feb 1, 2017
8214035
Add disable privatekeys option to createwallet
jonasschnelli Jun 13, 2018
056b0ea
[QA] add createwallet disableprivatekey test
jonasschnelli Jun 13, 2018
95d2546
QA: Fix bug in -usecli logic that converts booleans to non-lowercase …
jonasschnelli Jun 14, 2018
159eb20
docs: Specify preferred Python string formatting technique
Jul 19, 2018
baed22b
Remove dead service bits code
Nov 8, 2017
c833aca
lint: Add linter for circular dependencies
Empact Jul 17, 2018
c472ae0
Replace boost program_options
ken2812221 Jun 16, 2018
db06816
Remove program options from build system
ken2812221 Jun 16, 2018
2670be2
Fix bitcoin-cli --version
Empact Jul 20, 2018
7dd7dfa
Removes the boost/algorithm/string/join dependency
l2a5b1 Jul 20, 2018
62e516e
wallet: Avoid potential null pointer dereference in CWalletTx::GetAva…
practicalswift Jul 17, 2018
19203c0
trivial: Replace CPubKey::operator[] with CPubKey::vch where possible
hmel Jul 20, 2018
8a875d6
Remove redundant forward declaration
practicalswift Jul 17, 2018
0cdc6a0
Remove redundant unused variables
practicalswift Jul 17, 2018
e32c978
Remove redundant statement
practicalswift Jul 17, 2018
22fbbfb
[RPC] Remove field in getblocktemplate help that has never been used
conscott Mar 22, 2018
0930905
Avoid locking mutexes that are already held by the same thread
practicalswift Feb 22, 2018
56268b4
tiny refactor for ArgsManager
AtsukiTak Jul 21, 2018
b1d7b1e
Drop dead code from Stacks
Empact Jul 6, 2018
66f9bb9
Net: Fixed a race condition when disabling the network.
lmanners May 10, 2018
2c61338
trivial: remove unneeded include
hmel Jul 22, 2018
83975fd
Avoid creating a temporary vector for size-prefixed elements
sipa Jul 19, 2018
4cf7d34
Skip is_closing() check when not available.
domob1812 Jul 23, 2018
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
108 changes: 0 additions & 108 deletions build-aux/m4/ax_boost_program_options.m4

This file was deleted.

3 changes: 1 addition & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,6 @@ if test x$want_boost = xno; then
fi
AX_BOOST_SYSTEM
AX_BOOST_FILESYSTEM
AX_BOOST_PROGRAM_OPTIONS
AX_BOOST_THREAD
AX_BOOST_CHRONO

Expand Down Expand Up @@ -971,7 +970,7 @@ fi

if test x$use_boost = xyes; then

BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB $BOOST_CHRONO_LIB"
BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_THREAD_LIB $BOOST_CHRONO_LIB"


dnl If boost (prior to 1.57) was built without c++11, it emulated scoped enums
Expand Down
2 changes: 1 addition & 1 deletion depends/packages/boost.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $(package)_toolset_$(host_os)=gcc
$(package)_archiver_$(host_os)=$($(package)_ar)
$(package)_toolset_darwin=darwin
$(package)_archiver_darwin=$($(package)_libtool)
$(package)_config_libraries=chrono,filesystem,program_options,system,thread,test
$(package)_config_libraries=chrono,filesystem,system,thread,test
$(package)_cxxflags=-std=c++11 -fvisibility=hidden
$(package)_cxxflags_linux=-fPIC
endef
Expand Down
2 changes: 1 addition & 1 deletion depends/packages/zeromq.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $(package)_sha256_hash=8f1e2b2aade4dbfde98d82366d61baef2f62e812530160d2e6d0a5bb2
$(package)_patches=0001-fix-build-with-older-mingw64.patch 0002-disable-pthread_set_name_np.patch

define $(package)_set_vars
$(package)_config_opts=--without-docs --disable-shared --without-libsodium --disable-curve --disable-curve-keygen --disable-perf
$(package)_config_opts=--without-docs --disable-shared --without-libsodium --disable-curve --disable-curve-keygen --disable-perf --disable-Werror
$(package)_config_opts_linux=--with-pic
$(package)_cxxflags=-std=c++11
endef
Expand Down
2 changes: 1 addition & 1 deletion doc/build-unix.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ tuned to conserve memory with additional CXXFLAGS:

Build requirements:

sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3 libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev
sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3 libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev

BerkeleyDB is required for the wallet.

Expand Down
1 change: 1 addition & 0 deletions src/bitcoin-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ static void SetupCliArgs()
const auto testnetBaseParams = CreateBaseChainParams(CBaseChainParams::TESTNET);

gArgs.AddArg("-?", "This help message", false, OptionsCategory::OPTIONS);
gArgs.AddArg("-version", "Print version and exit", false, OptionsCategory::OPTIONS);
gArgs.AddArg("-conf=<file>", strprintf("Specify configuration file. Relative paths will be prefixed by datadir location. (default: %s)", BITCOIN_CONF_FILENAME), false, OptionsCategory::OPTIONS);
gArgs.AddArg("-datadir=<dir>", "Specify data directory", false, OptionsCategory::OPTIONS);
gArgs.AddArg("-getinfo", "Get general information from the remote server. Note that unlike server-side RPC calls, the results of -getinfo is the result of multiple non-atomic requests. Some entries in the result may represent results from different states (e.g. wallet balance may be as of a different block from the chain state reported)", false, OptionsCategory::OPTIONS);
Expand Down
2 changes: 0 additions & 2 deletions src/bitcoind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
#include <utilstrencodings.h>
#include <walletinitinterface.h>

#include <boost/thread.hpp>

#include <stdio.h>

/* Introduction text for doxygen: */
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ class WalletImpl : public Wallet
}
unsigned int getConfirmTarget() override { return m_wallet.m_confirm_target; }
bool hdEnabled() override { return m_wallet.IsHDEnabled(); }
bool IsWalletFlagSet(uint64_t flag) override { return m_wallet.IsWalletFlagSet(flag); }
OutputType getDefaultAddressType() override { return m_wallet.m_default_address_type; }
OutputType getDefaultChangeType() override { return m_wallet.m_default_change_type; }
std::unique_ptr<Handler> handleUnload(UnloadFn fn) override
Expand Down
3 changes: 3 additions & 0 deletions src/interfaces/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ class Wallet
// Return whether HD enabled.
virtual bool hdEnabled() = 0;

// check if a certain wallet flag is set.
virtual bool IsWalletFlagSet(uint64_t flag) = 0;

// Get default address type.
virtual OutputType getDefaultAddressType() = 0;

Expand Down
19 changes: 11 additions & 8 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,17 @@ void CConnman::ThreadSocketHandler()
//
{
LOCK(cs_vNodes);

if (!fNetworkActive) {
// Disconnect any connected nodes
for (CNode* pnode : vNodes) {
if (!pnode->fDisconnect) {
LogPrint(BCLog::NET, "Network not active, dropping peer=%d\n", pnode->GetId());
pnode->fDisconnect = true;
}
}
}

// Disconnect unused nodes
std::vector<CNode*> vNodesCopy = vNodes;
for (CNode* pnode : vNodesCopy)
Expand Down Expand Up @@ -2198,14 +2209,6 @@ void CConnman::SetNetworkActive(bool active)

fNetworkActive = active;

if (!fNetworkActive) {
LOCK(cs_vNodes);
// Close sockets to all nodes
for (CNode* pnode : vNodes) {
pnode->CloseSocketDisconnect();
}
}

uiInterface.NotifyNetworkActiveChanged(fNetworkActive);
}

Expand Down
11 changes: 0 additions & 11 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1661,17 +1661,6 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
return false;
}

if (nServices & ((1 << 7) | (1 << 5))) {
if (GetTime() < 1533096000) {
// Immediately disconnect peers that use service bits 6 or 8 until August 1st, 2018
// These bits have been used as a flag to indicate that a node is running incompatible
// consensus rules instead of changing the network magic, so we're stuck disconnecting
// based on these service bits, at least for a while.
pfrom->fDisconnect = true;
return false;
}
}

if (nVersion < MIN_PEER_PROTO_VERSION)
{
// disconnect from peers older than this proto version
Expand Down
8 changes: 4 additions & 4 deletions src/pubkey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ bool CPubKey::Verify(const uint256 &hash, const std::vector<unsigned char>& vchS
return false;
secp256k1_pubkey pubkey;
secp256k1_ecdsa_signature sig;
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size())) {
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, vch, size())) {
return false;
}
if (!ecdsa_signature_parse_der_lax(secp256k1_context_verify, &sig, vchSig.data(), vchSig.size())) {
Expand Down Expand Up @@ -207,14 +207,14 @@ bool CPubKey::IsFullyValid() const {
if (!IsValid())
return false;
secp256k1_pubkey pubkey;
return secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size());
return secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, vch, size());
}

bool CPubKey::Decompress() {
if (!IsValid())
return false;
secp256k1_pubkey pubkey;
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size())) {
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, vch, size())) {
return false;
}
unsigned char pub[PUBLIC_KEY_SIZE];
Expand All @@ -232,7 +232,7 @@ bool CPubKey::Derive(CPubKey& pubkeyChild, ChainCode &ccChild, unsigned int nChi
BIP32Hash(cc, nChild, *begin(), begin()+1, out);
memcpy(ccChild.begin(), out+32, 32);
secp256k1_pubkey pubkey;
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size())) {
if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, vch, size())) {
return false;
}
if (!secp256k1_ec_pubkey_tweak_add(secp256k1_context_verify, &pubkey, out)) {
Expand Down
2 changes: 0 additions & 2 deletions src/qt/clientmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
#include <QDebug>
#include <QTimer>

class CBlockIndex;

static int64_t nLastHeaderTipUpdateNotification = 0;
static int64_t nLastBlockTipUpdateNotification = 0;

Expand Down
3 changes: 3 additions & 0 deletions src/qt/receivecoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model)
} else {
ui->useBech32->setCheckState(Qt::Unchecked);
}

// eventually disable the main receive button if private key operations are disabled
ui->receiveButton->setEnabled(!model->privateKeysDisabled());
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/qt/walletmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,11 @@ bool WalletModel::isWalletEnabled()
return !gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET);
}

bool WalletModel::privateKeysDisabled() const
{
return m_wallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS);
}

QString WalletModel::getWalletName() const
{
return QString::fromStdString(m_wallet->getWalletName());
Expand Down
1 change: 1 addition & 0 deletions src/qt/walletmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ class WalletModel : public QObject
bool bumpFee(uint256 hash);

static bool isWalletEnabled();
bool privateKeysDisabled() const;

interfaces::Node& node() const { return m_node; }
interfaces::Wallet& wallet() const { return *m_wallet; }
Expand Down
1 change: 1 addition & 0 deletions src/rpc/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ static const CRPCConvertParam vRPCConvertParams[] =
{ "echojson", 9, "arg9" },
{ "rescanblockchain", 0, "start_height"},
{ "rescanblockchain", 1, "stop_height"},
{ "createwallet", 1, "disable_private_keys"},
};

class CRPCConvertTable
Expand Down
1 change: 0 additions & 1 deletion src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
" \"fee\": n, (numeric) difference in value between transaction inputs and outputs (in satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one\n"
" \"sigops\" : n, (numeric) total SigOps cost, as counted for purposes of block limits; if key is not present, sigop cost is unknown and clients MUST NOT assume it is zero\n"
" \"weight\" : n, (numeric) total transaction weight, as counted for purposes of block limits\n"
" \"required\" : true|false (boolean) if provided and true, this transaction must be in the final block\n"
" }\n"
" ,...\n"
" ],\n"
Expand Down
11 changes: 2 additions & 9 deletions src/script/sign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,18 +288,11 @@ struct Stacks
std::vector<valtype> script;
std::vector<valtype> witness;

Stacks() {}
explicit Stacks(const std::vector<valtype>& scriptSigStack_) : script(scriptSigStack_), witness() {}
Stacks() = delete;
Stacks(const Stacks&) = delete;
explicit Stacks(const SignatureData& data) : witness(data.scriptWitness.stack) {
EvalScript(script, data.scriptSig, SCRIPT_VERIFY_STRICTENC, BaseSignatureChecker(), SigVersion::BASE);
}

SignatureData Output() const {
SignatureData result;
result.scriptSig = PushAll(script);
result.scriptWitness.stack = witness;
return result;
}
};
}

Expand Down
18 changes: 8 additions & 10 deletions src/script/sign.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,26 +116,24 @@ static constexpr uint8_t PSBT_OUT_BIP32_DERIVATION = 0x02;
// as a 0 length key which indicates that this is the separator. The separator has no value.
static constexpr uint8_t PSBT_SEPARATOR = 0x00;

// Takes a stream and multiple arguments and serializes them into a vector and then into the stream
// Takes a stream and multiple arguments and serializes them as if first serialized into a vector and then into the stream
// The resulting output into the stream has the total serialized length of all of the objects followed by all objects concatenated with each other.
template<typename Stream, typename... X>
void SerializeToVector(Stream& s, const X&... args)
{
std::vector<unsigned char> ret;
CVectorWriter ss(SER_NETWORK, PROTOCOL_VERSION, ret, 0);
SerializeMany(ss, args...);
s << ret;
WriteCompactSize(s, GetSerializeSizeMany(s, args...));
SerializeMany(s, args...);
}

// Takes a stream and multiple arguments and unserializes them first as a vector then each object individually in the order provided in the arguments
template<typename Stream, typename... X>
void UnserializeFromVector(Stream& s, X&... args)
{
std::vector<unsigned char> data;
s >> data;
CDataStream ss(data, SER_NETWORK, PROTOCOL_VERSION);
UnserializeMany(ss, args...);
if (!ss.eof()) {
size_t expected_size = ReadCompactSize(s);
size_t remaining_before = s.size();
UnserializeMany(s, args...);
size_t remaining_after = s.size();
if (remaining_after + expected_size != remaining_before) {
throw std::ios_base::failure("Size of value was not the stated size");
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/script/standard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,6 @@ CScript GetScriptForMultisig(int nRequired, const std::vector<CPubKey>& keys)

CScript GetScriptForWitness(const CScript& redeemscript)
{
CScript ret;

txnouttype typ;
std::vector<std::vector<unsigned char> > vSolutions;
if (Solver(redeemscript, typ, vSolutions)) {
Expand Down
Loading