diff --git a/src/Makefile.am b/src/Makefile.am index 880d69608b..d7a5252636 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -943,8 +943,7 @@ bitcoin_chainstate_SOURCES += \ script/pegins.cpp \ script/sign.cpp \ script/signingprovider.cpp \ - support/events.h \ - util/url.cpp + support/events.h # $(LIBTOOL_APP_LDFLAGS) deliberately omitted here so that we can test linking diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 7142f1a4d6..0db6e90d48 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2803,8 +2803,8 @@ void PeerManagerImpl::ProcessHeadersMessage(CNode& pfrom, Peer& peer, // If we are already too far ahead of where we want to be on headers, discard // the received headers. We can still get ahead by up to a single maximum-sized // headers message here, but never further, so that's fine. - if (m_chainman.m_best_header) { - int64_t headers_ahead = m_chainman.m_best_header->nHeight - WITH_LOCK(::cs_main, return m_chainman.ActiveHeight()); + if (WITH_LOCK(::cs_main, return m_chainman.m_best_header)) { + int64_t headers_ahead = WITH_LOCK(::cs_main, return m_chainman.m_best_header->nHeight - m_chainman.ActiveHeight()); bool too_far_ahead = node::fTrimHeaders && (headers_ahead >= node::nHeaderDownloadBuffer); if (too_far_ahead) { LOCK(cs_main); diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp index 42af6cd603..63191aa658 100644 --- a/src/rpc/util.cpp +++ b/src/rpc/util.cpp @@ -971,8 +971,8 @@ UniValue RPCResult::MatchesType(const UniValue& result) const // return true; // } - // const auto exp_type = ExpectedType(m_type); - // if (!exp_type) return true; // can be any type, so nothing to check + const auto exp_type = ExpectedType(m_type); + if (!exp_type) return true; // can be any type, so nothing to check // if (*exp_type != result.getType()) { // return strprintf("returned type is %s, but declared as %s in doc", uvTypeName(result.getType()), uvTypeName(*exp_type)); diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp index 2e479371d9..5bffd95062 100644 --- a/src/wallet/test/wallet_tests.cpp +++ b/src/wallet/test/wallet_tests.cpp @@ -586,7 +586,9 @@ BOOST_FIXTURE_TEST_CASE(ListCoinsTest, ListCoinsTestingSetup) BOOST_CHECK_EQUAL(list.begin()->second.size(), 1U); // Check initial balance from one mature coinbase transaction. - BOOST_CHECK_EQUAL(50 * COIN, WITH_LOCK(wallet->cs_wallet, return AvailableCoins(*wallet).GetTotalAmount()[CAsset()])); + auto balance = WITH_LOCK(wallet->cs_wallet, return AvailableCoins(*wallet).GetTotalAmount()); + auto expected = balance[CAsset()]; + BOOST_CHECK_EQUAL(50 * COIN, expected); // Add a transaction creating a change address, and confirm ListCoins still // returns the coin associated with the change address underneath the