aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml10
-rw-r--r--src/pubkey.cpp8
-rw-r--r--src/qt/clientmodel.cpp2
-rw-r--r--src/rpc/mining.cpp1
-rw-r--r--src/script/standard.cpp2
-rw-r--r--src/test/miner_tests.cpp2
-rw-r--r--src/test/transaction_tests.cpp1
-rw-r--r--src/txmempool.cpp3
-rw-r--r--src/txmempool.h2
-rw-r--r--src/validation.cpp16
-rw-r--r--src/wallet/coinselection.cpp2
-rw-r--r--src/wallet/wallet.cpp1
-rwxr-xr-xtest/lint/lint-includes.sh1
13 files changed, 24 insertions, 27 deletions
diff --git a/.travis.yml b/.travis.yml
index 901334d9b6..1e6fc0a518 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -81,15 +81,13 @@ after_script:
jobs:
include:
- stage: lint
+ env:
sudo: false
cache: false
- addons:
- apt:
- packages:
- - python3-pip
- - shellcheck
+ language: python
+ python: '3.6'
install:
- - travis_retry pip3 install flake8 --user
+ - travis_retry pip install flake8
before_script:
- git fetch --unshallow
script:
diff --git a/src/pubkey.cpp b/src/pubkey.cpp
index 6e601a6f13..1eb126434b 100644
--- a/src/pubkey.cpp
+++ b/src/pubkey.cpp
@@ -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())) {
@@ -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];
@@ -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)) {
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index a623771aa0..8a4a2955f6 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -28,8 +28,6 @@
#include <QDebug>
#include <QTimer>
-class CBlockIndex;
-
static int64_t nLastHeaderTipUpdateNotification = 0;
static int64_t nLastBlockTipUpdateNotification = 0;
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp
index 1f1044d80b..e751587dc7 100644
--- a/src/rpc/mining.cpp
+++ b/src/rpc/mining.cpp
@@ -337,7 +337,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"
diff --git a/src/script/standard.cpp b/src/script/standard.cpp
index f0b2c62a91..d7b1724790 100644
--- a/src/script/standard.cpp
+++ b/src/script/standard.cpp
@@ -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)) {
diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp
index 9a325f5f4c..10c7fd00e8 100644
--- a/src/test/miner_tests.cpp
+++ b/src/test/miner_tests.cpp
@@ -209,7 +209,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
const CChainParams& chainparams = *chainParams;
CScript scriptPubKey = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG;
std::unique_ptr<CBlockTemplate> pblocktemplate;
- CMutableTransaction tx,tx2;
+ CMutableTransaction tx;
CScript script;
uint256 hash;
TestMemPoolEntryHelper entry;
diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp
index 45dc0e3571..aff270942e 100644
--- a/src/test/transaction_tests.cpp
+++ b/src/test/transaction_tests.cpp
@@ -547,7 +547,6 @@ BOOST_AUTO_TEST_CASE(test_witness)
CTransactionRef output1, output2;
CMutableTransaction input1, input2;
- SignatureData sigdata;
// Normal pay-to-compressed-pubkey.
CreateCreditAndSpend(keystore, scriptPubkey1, output1, input1);
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index 8090172e3f..d579f131cd 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -542,7 +542,7 @@ void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMem
void CTxMemPool::removeConflicts(const CTransaction &tx)
{
// Remove transactions which depend on inputs of tx, recursively
- LOCK(cs);
+ AssertLockHeld(cs);
for (const CTxIn &txin : tx.vin) {
auto it = mapNextTx.find(txin.prevout);
if (it != mapNextTx.end()) {
@@ -716,7 +716,6 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
while (!waitingOnDependants.empty()) {
const CTxMemPoolEntry* entry = waitingOnDependants.front();
waitingOnDependants.pop_front();
- CValidationState state;
if (!mempoolDuplicate.HaveInputs(entry->GetTx())) {
waitingOnDependants.push_back(entry);
stepsSinceLastRemove++;
diff --git a/src/txmempool.h b/src/txmempool.h
index ebfcf36e11..784d5453b2 100644
--- a/src/txmempool.h
+++ b/src/txmempool.h
@@ -544,7 +544,7 @@ public:
void removeRecursive(const CTransaction &tx, MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN);
void removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags);
- void removeConflicts(const CTransaction &tx);
+ void removeConflicts(const CTransaction &tx) EXCLUSIVE_LOCKS_REQUIRED(cs);
void removeForBlock(const std::vector<CTransactionRef>& vtx, unsigned int nBlockHeight);
void clear();
diff --git a/src/validation.cpp b/src/validation.cpp
index a30f1fd0ce..f1b63b5b44 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -45,7 +45,6 @@
#include <sstream>
#include <boost/algorithm/string/replace.hpp>
-#include <boost/algorithm/string/join.hpp>
#include <boost/thread.hpp>
#if defined(NDEBUG)
@@ -2242,6 +2241,13 @@ static void DoWarning(const std::string& strWarning)
}
}
+/** Private helper function that concatenates warning messages. */
+static void AppendWarning(std::string& res, const std::string& warn)
+{
+ if (!res.empty()) res += ", ";
+ res += warn;
+}
+
/** Check warning conditions and do some notifications on new chain tip set. */
void static UpdateTip(const CBlockIndex *pindexNew, const CChainParams& chainParams) {
// New best block
@@ -2253,7 +2259,7 @@ void static UpdateTip(const CBlockIndex *pindexNew, const CChainParams& chainPar
g_best_block_cv.notify_all();
}
- std::vector<std::string> warningMessages;
+ std::string warningMessages;
if (!IsInitialBlockDownload())
{
int nUpgraded = 0;
@@ -2266,7 +2272,7 @@ void static UpdateTip(const CBlockIndex *pindexNew, const CChainParams& chainPar
if (state == ThresholdState::ACTIVE) {
DoWarning(strWarning);
} else {
- warningMessages.push_back(strWarning);
+ AppendWarning(warningMessages, strWarning);
}
}
}
@@ -2279,7 +2285,7 @@ void static UpdateTip(const CBlockIndex *pindexNew, const CChainParams& chainPar
pindex = pindex->pprev;
}
if (nUpgraded > 0)
- warningMessages.push_back(strprintf(_("%d of last 100 blocks have unexpected version"), nUpgraded));
+ AppendWarning(warningMessages, strprintf(_("%d of last 100 blocks have unexpected version"), nUpgraded));
if (nUpgraded > 100/2)
{
std::string strWarning = _("Warning: Unknown block versions being mined! It's possible unknown rules are in effect");
@@ -2293,7 +2299,7 @@ void static UpdateTip(const CBlockIndex *pindexNew, const CChainParams& chainPar
FormatISO8601DateTime(pindexNew->GetBlockTime()),
GuessVerificationProgress(chainParams.TxData(), pindexNew), pcoinsTip->DynamicMemoryUsage() * (1.0 / (1<<20)), pcoinsTip->GetCacheSize());
if (!warningMessages.empty())
- LogPrintf(" warning='%s'", boost::algorithm::join(warningMessages, ", ")); /* Continued */
+ LogPrintf(" warning='%s'", warningMessages); /* Continued */
LogPrintf("\n");
}
diff --git a/src/wallet/coinselection.cpp b/src/wallet/coinselection.cpp
index a403411e5b..78258cdec2 100644
--- a/src/wallet/coinselection.cpp
+++ b/src/wallet/coinselection.cpp
@@ -115,7 +115,7 @@ bool SelectCoinsBnB(std::vector<CInputCoin>& utxo_pool, const CAmount& target_va
while (!curr_selection.empty() && !curr_selection.back()) {
curr_selection.pop_back();
curr_available_value += utxo_pool.at(curr_selection.size()).effective_value;
- };
+ }
if (curr_selection.empty()) { // We have walked back to the first utxo and no branch is untraversed. All solutions searched
break;
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index aeed430111..d38f943558 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -1977,6 +1977,7 @@ CAmount CWalletTx::GetAvailableCredit(bool fUseCache, const isminefilter& filter
if (cache) {
*cache = nCredit;
+ assert(cache_used);
*cache_used = true;
}
return nCredit;
diff --git a/test/lint/lint-includes.sh b/test/lint/lint-includes.sh
index 52b327f955..2faaef8954 100755
--- a/test/lint/lint-includes.sh
+++ b/test/lint/lint-includes.sh
@@ -49,7 +49,6 @@ EXPECTED_BOOST_INCLUDES=(
boost/algorithm/string.hpp
boost/algorithm/string/case_conv.hpp
boost/algorithm/string/classification.hpp
- boost/algorithm/string/join.hpp
boost/algorithm/string/predicate.hpp
boost/algorithm/string/replace.hpp
boost/algorithm/string/split.hpp