Skip to content

Commit 3ca9aa3

Browse files
committed
revert
1 parent 090744c commit 3ca9aa3

File tree

14 files changed

+17
-67
lines changed

14 files changed

+17
-67
lines changed

src/addrdb.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ bool SerializeDB(Stream& stream, const Data& data)
3333
{
3434
// Write and commit header, data
3535
try {
36-
HashedSourceWriter hashwriter{stream};
37-
hashwriter << Params().MessageStart() << data;
38-
stream << hashwriter.GetHash();
36+
CHashWriter hasher(stream.GetType(), stream.GetVersion());
37+
stream << Params().MessageStart() << data;
38+
hasher << Params().MessageStart() << data;
39+
stream << hasher.GetHash();
3940
} catch (const std::exception& e) {
4041
return error("%s: Serialize or I/O error - %s", __func__, e.what());
4142
}

src/addrman.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,8 @@ void AddrMan::Unserialize(Stream& s_)
11711171
}
11721172

11731173
// explicit instantiation
1174-
template void AddrMan::Serialize(HashedSourceWriter<CAutoFile>& s) const;
1174+
template void AddrMan::Serialize(CHashWriter& s) const;
1175+
template void AddrMan::Serialize(CAutoFile& s) const;
11751176
template void AddrMan::Serialize(CDataStream& s) const;
11761177
template void AddrMan::Unserialize(CAutoFile& s);
11771178
template void AddrMan::Unserialize(CHashVerifier<CAutoFile>& s);

src/chainparams.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ class CRegTestParams : public CChainParams {
597597
consensus.BIP65Height = 1; // Always active unless overridden
598598
consensus.BIP66Height = 1; // Always active unless overridden
599599
consensus.CSVHeight = 1; // Always active unless overridden
600-
consensus.SegwitHeight = 0; // Always active unless overridden
600+
consensus.SegwitHeight = 1; // Always active unless overridden
601601
consensus.MinBIP9WarningHeight = 0;
602602
consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
603603
consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks

src/hash.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -188,30 +188,6 @@ class CHashVerifier : public CHashWriter
188188
}
189189
};
190190

191-
/** Writes data to an underlying source stream, while hashing the written data. */
192-
template <typename Source>
193-
class HashedSourceWriter : public CHashWriter
194-
{
195-
private:
196-
Source& m_source;
197-
198-
public:
199-
explicit HashedSourceWriter(Source& source LIFETIMEBOUND) : CHashWriter{source.GetType(), source.GetVersion()}, m_source{source} {}
200-
201-
void write(Span<const std::byte> src)
202-
{
203-
m_source.write(src);
204-
CHashWriter::write(src);
205-
}
206-
207-
template <typename T>
208-
HashedSourceWriter& operator<<(const T& obj)
209-
{
210-
::Serialize(*this, obj);
211-
return *this;
212-
}
213-
};
214-
215191
/** Compute the 256-bit hash of an object's serialization, with optional sighash byte. */
216192
template<typename T>
217193
uint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION)

src/logging.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ const CLogCategoryDesc LogCategories[] =
160160
{BCLog::VALIDATION, "validation"},
161161
{BCLog::I2P, "i2p"},
162162
{BCLog::IPC, "ipc"},
163-
#ifdef DEBUG_LOCKCONTENTION
164163
{BCLog::LOCK, "lock"},
165-
#endif
166164
{BCLog::UTIL, "util"},
167165
{BCLog::BLOCKSTORE, "blockstorage"},
168166
{BCLog::ALL, "1"},

src/logging.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ namespace BCLog {
6060
VALIDATION = (1 << 21),
6161
I2P = (1 << 22),
6262
IPC = (1 << 23),
63-
#ifdef DEBUG_LOCKCONTENTION
6463
LOCK = (1 << 24),
65-
#endif
6664
UTIL = (1 << 25),
6765
BLOCKSTORE = (1 << 26),
6866
ALL = ~(uint32_t)0,

src/net.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <crypto/siphash.h>
1414
#include <hash.h>
1515
#include <i2p.h>
16-
#include <logging.h>
1716
#include <net_permissions.h>
1817
#include <netaddress.h>
1918
#include <netbase.h>
@@ -33,7 +32,6 @@
3332
#include <cstdint>
3433
#include <deque>
3534
#include <functional>
36-
#include <list>
3735
#include <map>
3836
#include <memory>
3937
#include <optional>

src/rpc/blockchain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,7 +1621,7 @@ static void SoftForkDescPushBack(const CBlockIndex* blockindex, UniValue& softfo
16211621
// BIP9 status
16221622
bip9.pushKV("status", get_state_name(current_state));
16231623
bip9.pushKV("since", g_versionbitscache.StateSinceHeight(blockindex->pprev, consensusParams, id));
1624-
bip9.pushKV("status_next", get_state_name(next_state));
1624+
bip9.pushKV("status-next", get_state_name(next_state));
16251625

16261626
// BIP9 signalling status, if applicable
16271627
if (has_signal) {
@@ -1813,7 +1813,7 @@ const std::vector<RPCResult> RPCHelpForDeployment{
18131813
{RPCResult::Type::NUM, "min_activation_height", "minimum height of blocks for which the rules may be enforced"},
18141814
{RPCResult::Type::STR, "status", "status of deployment at specified block (one of \"defined\", \"started\", \"locked_in\", \"active\", \"failed\")"},
18151815
{RPCResult::Type::NUM, "since", "height of the first block to which the status applies"},
1816-
{RPCResult::Type::STR, "status_next", "status of deployment at the next block"},
1816+
{RPCResult::Type::STR, "status-next", "status of deployment at the next block"},
18171817
{RPCResult::Type::OBJ, "statistics", /*optional=*/true, "numeric statistics about signalling for a softfork (only for \"started\" and \"locked_in\" status)",
18181818
{
18191819
{RPCResult::Type::NUM, "period", "the length in blocks of the signalling period"},

src/sync.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66
#ifndef BITCOIN_SYNC_H
77
#define BITCOIN_SYNC_H
88

9-
#ifdef DEBUG_LOCKCONTENTION
109
#include <logging.h>
1110
#include <logging/timer.h>
12-
#endif
13-
1411
#include <threadsafety.h>
1512
#include <util/macros.h>
1613

@@ -139,10 +136,8 @@ class SCOPED_LOCKABLE UniqueLock : public Base
139136
void Enter(const char* pszName, const char* pszFile, int nLine)
140137
{
141138
EnterCritical(pszName, pszFile, nLine, Base::mutex());
142-
#ifdef DEBUG_LOCKCONTENTION
143139
if (Base::try_lock()) return;
144140
LOG_TIME_MICROS_WITH_CATEGORY(strprintf("lock contention %s, %s:%d", pszName, pszFile, nLine), BCLog::LOCK);
145-
#endif
146141
Base::lock();
147142
}
148143

src/test/checkqueue_tests.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,13 @@
1919
#include <vector>
2020

2121
/**
22-
* Identical to TestingSetup but excludes lock contention logging if
23-
* `DEBUG_LOCKCONTENTION` is defined, as some of these tests are designed to be
24-
* heavily contested to trigger race conditions or other issues.
22+
* Identical to TestingSetup but excludes lock contention logging, as some of
23+
* these tests are designed to be heavily contested to trigger race conditions
24+
* or other issues.
2525
*/
2626
struct NoLockLoggingTestingSetup : public TestingSetup {
2727
NoLockLoggingTestingSetup()
28-
#ifdef DEBUG_LOCKCONTENTION
2928
: TestingSetup{CBaseChainParams::MAIN, /*extra_args=*/{"-debugexclude=lock"}} {}
30-
#else
31-
: TestingSetup{CBaseChainParams::MAIN} {}
32-
#endif
3329
};
3430

3531
BOOST_FIXTURE_TEST_SUITE(checkqueue_tests, NoLockLoggingTestingSetup)

0 commit comments

Comments
 (0)