|
26 | 26 | #include <util/translation.h> |
27 | 27 |
|
28 | 28 | 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>()) |
31 | 31 | { |
32 | 32 | } |
33 | 33 |
|
@@ -109,13 +109,13 @@ bool SerializeFileDB(const std::string& prefix, const fs::path& path, const Data |
109 | 109 | { |
110 | 110 | // Generate random temporary filename |
111 | 111 | uint16_t randv = 0; |
112 | | - GetRandBytes((unsigned char*)&randv, sizeof(randv)); |
| 112 | + GetRandBytes({(unsigned char*)&randv, sizeof(randv)}); |
113 | 113 | std::string tmpfn = strprintf("%s.%04x", prefix, randv); |
114 | 114 |
|
115 | 115 | // open temp output file, and associate with CAutoFile |
116 | | - fs::path pathTmp = gArgs.GetDataDirNet() / tmpfn; |
| 116 | + fs::path pathTmp = gArgs.GetDataDirNet() / fs::u8path(tmpfn); |
117 | 117 | FILE *file = fsbridge::fopen(pathTmp, "wb"); |
118 | | - CAutoFile fileout(file, SER_DISK, version); |
| 118 | + CAutoFile fileout(file, version); |
119 | 119 | if (fileout.IsNull()) { |
120 | 120 | fileout.fclose(); |
121 | 121 | remove(pathTmp); |
@@ -148,7 +148,7 @@ template <typename Stream, typename Data> |
148 | 148 | bool DeserializeDB(Stream& stream, Data& data, bool fCheckSum = true) |
149 | 149 | { |
150 | 150 | try { |
151 | | - CHashVerifier<Stream> verifier(&stream); |
| 151 | + HashVerifier<Stream> verifier(stream); |
152 | 152 | // de-serialize file header (network specific magic number) and .. |
153 | 153 | unsigned char pchMsgTmp[4]; |
154 | 154 | verifier >> pchMsgTmp; |
@@ -180,7 +180,7 @@ bool DeserializeFileDB(const fs::path& path, Data& data, int version) |
180 | 180 | { |
181 | 181 | // open input file, and associate with CAutoFile |
182 | 182 | FILE* file = fsbridge::fopen(path, "rb"); |
183 | | - CAutoFile filein(file, SER_DISK, version); |
| 183 | + CAutoFile filein(file, version); |
184 | 184 | if (filein.IsNull()) { |
185 | 185 | LogPrintf("Missing or invalid file %s\n", path.string()); |
186 | 186 | return false; |
|
0 commit comments