MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / SerializeDB

Function SerializeDB

src/addrdb.cpp:20–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19template <typename Stream, typename Data>
20bool SerializeDB(Stream& stream, const Data& data)
21{
22 // Write and commit header, data
23 try {
24 CHashWriter hasher(SER_DISK, CLIENT_VERSION);
25 stream << Params().MessageStart() << data;
26 hasher << Params().MessageStart() << data;
27 stream << hasher.GetHash();
28 } catch (const std::exception& e) {
29 return error("%s: Serialize or I/O error - %s", __func__, e.what());
30 }
31
32 return true;
33}
34
35template <typename Data>
36bool SerializeFileDB(const std::string& prefix, const fs::path& path, const Data& data)

Callers 1

SerializeFileDBFunction · 0.85

Calls 4

errorFunction · 0.85
whatMethod · 0.80
ParamsClass · 0.70
GetHashMethod · 0.45

Tested by

no test coverage detected