19 return std::make_pair(
false,
"");
23 const size_t n =
fread(buffer, 1, std::min(
sizeof(buffer),
maxsize - retval.size()),
f);
28 return std::make_pair(
false,
"");
30 retval.append(buffer, buffer+n);
31 }
while (!feof(
f) && retval.size() <
maxsize);
33 return std::make_pair(
true,retval);
static const PrecomputedData data
Precomputed COutPoint and CCoins values.
FILE * fopen(const fs::path &p, const char *mode)
bool WriteBinaryFile(const fs::path &filename, const std::string &data)
Write contents of std::string to a file.
std::pair< bool, std::string > ReadBinaryFile(const fs::path &filename, size_t maxsize)
Read full contents of a file and return them in a std::string.
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.