Skip to content

Commit d8f9dc0

Browse files
committed
Fix build: resolve copyright header errors in dbwrapper.cpp, deploymentstatus.cpp, and httpserver.h
- Add missing comment markers (//) to DigiByte copyright lines
1 parent f2e1736 commit d8f9dc0

8 files changed

Lines changed: 15 additions & 71 deletions

File tree

bitcoin-v26.2-for-digibyte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 47a73921b8599e9e883c3ad3bf18919a88bf4437

src/addrdb.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
#include <util/translation.h>
2727

2828
CBanEntry::CBanEntry(const UniValue& json)
29-
: nVersion(json["version"].get_int()), nCreateTime(json["ban_created"].get_int64()),
30-
nBanUntil(json["banned_until"].get_int64())
29+
: nVersion(json["version"].getInt<int>()), nCreateTime(json["ban_created"].getInt<int64_t>()),
30+
nBanUntil(json["banned_until"].getInt<int64_t>())
3131
{
3232
}
3333

@@ -109,13 +109,13 @@ bool SerializeFileDB(const std::string& prefix, const fs::path& path, const Data
109109
{
110110
// Generate random temporary filename
111111
uint16_t randv = 0;
112-
GetRandBytes((unsigned char*)&randv, sizeof(randv));
112+
GetRandBytes({(unsigned char*)&randv, sizeof(randv)});
113113
std::string tmpfn = strprintf("%s.%04x", prefix, randv);
114114

115115
// open temp output file, and associate with CAutoFile
116-
fs::path pathTmp = gArgs.GetDataDirNet() / tmpfn;
116+
fs::path pathTmp = gArgs.GetDataDirNet() / fs::u8path(tmpfn);
117117
FILE *file = fsbridge::fopen(pathTmp, "wb");
118-
CAutoFile fileout(file, SER_DISK, version);
118+
CAutoFile fileout(file, version);
119119
if (fileout.IsNull()) {
120120
fileout.fclose();
121121
remove(pathTmp);
@@ -148,7 +148,7 @@ template <typename Stream, typename Data>
148148
bool DeserializeDB(Stream& stream, Data& data, bool fCheckSum = true)
149149
{
150150
try {
151-
CHashVerifier<Stream> verifier(&stream);
151+
HashVerifier<Stream> verifier(stream);
152152
// de-serialize file header (network specific magic number) and ..
153153
unsigned char pchMsgTmp[4];
154154
verifier >> pchMsgTmp;
@@ -180,7 +180,7 @@ bool DeserializeFileDB(const fs::path& path, Data& data, int version)
180180
{
181181
// open input file, and associate with CAutoFile
182182
FILE* file = fsbridge::fopen(path, "rb");
183-
CAutoFile filein(file, SER_DISK, version);
183+
CAutoFile filein(file, version);
184184
if (filein.IsNull()) {
185185
LogPrintf("Missing or invalid file %s\n", path.string());
186186
return false;

src/addrdb.h

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -25,52 +25,6 @@ class CDataStream;
2525
class DataStream;
2626
class NetGroupManager;
2727

28-
class CBanEntry
29-
{
30-
public:
31-
static const int CURRENT_VERSION=1;
32-
int nVersion;
33-
int64_t nCreateTime;
34-
int64_t nBanUntil;
35-
36-
CBanEntry()
37-
{
38-
SetNull();
39-
}
40-
41-
explicit CBanEntry(int64_t nCreateTimeIn)
42-
{
43-
SetNull();
44-
nCreateTime = nCreateTimeIn;
45-
}
46-
47-
/**
48-
* Create a ban entry from JSON.
49-
* @param[in] json A JSON representation of a ban entry, as created by `ToJson()`.
50-
* @throw std::runtime_error if the JSON does not have the expected fields.
51-
*/
52-
explicit CBanEntry(const UniValue& json);
53-
54-
SERIALIZE_METHODS(CBanEntry, obj)
55-
{
56-
uint8_t ban_reason = 2; //! For backward compatibility
57-
READWRITE(obj.nVersion, obj.nCreateTime, obj.nBanUntil, ban_reason);
58-
}
59-
60-
void SetNull()
61-
{
62-
nVersion = CBanEntry::CURRENT_VERSION;
63-
nCreateTime = 0;
64-
nBanUntil = 0;
65-
}
66-
67-
/**
68-
* Generate a JSON representation of this ban entry.
69-
* @return JSON suitable for passing to the `CBanEntry(const UniValue&)` constructor.
70-
*/
71-
UniValue ToJson() const;
72-
};
73-
7428
/** Access to the (IP) address database (peers.dat) */
7529
/** Only used by tests. */
7630
void ReadFromStream(AddrMan& addr, DataStream& ssPeers);

src/banman.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ void BanMan::LoadBanlist()
3434
if (m_client_interface) m_client_interface->InitMessage(_("Loading banlist…").translated);
3535

3636
const auto start{SteadyClock::now()};
37-
if (m_ban_db.Read(m_banned)) {
37+
bool dirty = false;
38+
if (m_ban_db.Read(m_banned, dirty)) {
3839
SweepBanned(); // sweep out unused entries
3940

4041
LogPrint(BCLog::NET, "Loaded %d banned node addresses/subnets %dms\n", m_banned.size(),

src/chain.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,6 @@ class CBlockIndex
212212
//! DigiByte: Track last block per algorithm for multi-algo mining
213213
CBlockIndex *lastAlgoBlocks[NUM_ALGOS_IMPL];
214214

215-
/**
216-
* Default constructor (no header):
217-
*/
218-
CBlockIndex();
219215

220216
/**
221217
* Full constructor that copies fields from a block header.

src/dbwrapper.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
// Copyright (c) 2012-2019 The Bitcoin Core developers
33
// Copyright (c) 2014-2019 The Bitcoin Core developers
4-
Copyright (c) 2014-2019 The DigiByte Core developers
4+
// Copyright (c) 2014-2019 The DigiByte Core developers
55

66
// Copyright (c) 2012-2022 The Bitcoin Core developers
77

@@ -158,9 +158,6 @@ static leveldb::Options GetOptions(size_t nCacheSize)
158158
}
159159

160160

161-
CDBWrapper::CDBWrapper(const fs::path& path, size_t nCacheSize, bool fMemory, bool fWipe, bool obfuscate)
162-
: m_name{path.stem().string()}
163-
164161
struct CDBBatch::WriteBatchImpl {
165162
leveldb::WriteBatch batch;
166163
};
@@ -172,7 +169,6 @@ CDBBatch::CDBBatch(const CDBWrapper& _parent)
172169
CDBBatch::~CDBBatch() = default;
173170

174171
void CDBBatch::Clear()
175-
176172
{
177173
m_impl_batch->batch.Clear();
178174
size_estimate = 0;
@@ -342,10 +338,6 @@ const unsigned int CDBWrapper::OBFUSCATE_KEY_NUM_BYTES = 8;
342338
std::vector<unsigned char> CDBWrapper::CreateObfuscateKey() const
343339
{
344340
std::vector<uint8_t> ret(OBFUSCATE_KEY_NUM_BYTES);
345-
346-
GetRandBytes(ret.data(), OBFUSCATE_KEY_NUM_BYTES);
347-
return ret;
348-
349341
GetRandBytes(ret);
350342
return ret;
351343
}

src/deploymentstatus.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
// Copyright (c) 2020 The Bitcoin Core developers
3-
Copyright (c) 2020 The DigiByte Core developers
3+
// Copyright (c) 2020 The DigiByte Core developers
44

55
// Copyright (c) 2020-2022 The Bitcoin Core developers
6-
Copyright (c) 2020-2022 The DigiByte Core developers
6+
// Copyright (c) 2020-2022 The DigiByte Core developers
77

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

src/httpserver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22
// Copyright (c) 2015-2020 The Bitcoin Core developers
33
// Copyright (c) 2014-2020 The Bitcoin Core developers
4-
Copyright (c) 2014-2020 The DigiByte Core developers
4+
// Copyright (c) 2014-2020 The DigiByte Core developers
55

66
// Copyright (c) 2015-2022 The Bitcoin Core developers
7-
Copyright (c) 2015-2022 The DigiByte Core developers
7+
// Copyright (c) 2015-2022 The DigiByte Core developers
88

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

0 commit comments

Comments
 (0)