Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/interfaces/chain.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ struct BlockInfo {
const uint256* prev_hash = nullptr;
int height = -1;
int file_number = -1;
unsigned data_pos = 0;
uint64_t data_pos = 0;
const CBlock* data = nullptr;
const CBlockUndo* undo_data = nullptr;
// The maximum time in the chain up to and including this block.
Expand Down
5 changes: 3 additions & 2 deletions src/streams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <span.h>
#include <streams.h>
#include <util/fs_helpers.h>

#include <array>

Expand All @@ -13,7 +14,7 @@ std::size_t AutoFile::detail_fread(Span<std::byte> dst)
if (m_xor.empty()) {
return std::fread(dst.data(), 1, dst.size(), m_file);
} else {
const auto init_pos{std::ftell(m_file)};
const auto init_pos{FileTell64(m_file)};
if (init_pos < 0) throw std::ios_base::failure("AutoFile::read: ftell failed");
std::size_t ret{std::fread(dst.data(), 1, dst.size(), m_file)};
util::Xor(dst.subspan(0, ret), m_xor, init_pos);
Expand Down Expand Up @@ -49,7 +50,7 @@ void AutoFile::write(Span<const std::byte> src)
throw std::ios_base::failure("AutoFile::write: write failed");
}
} else {
auto current_pos{std::ftell(m_file)};
auto current_pos{FileTell64(m_file)};
if (current_pos < 0) throw std::ios_base::failure("AutoFile::write: ftell failed");
std::array<std::byte, 4096> buf;
while (src.size() > 0) {
Expand Down
Loading