mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
streams: cache file position within AutoFile
This commit is contained in:
parent
07c7c96022
commit
e624a9bef1
8 changed files with 48 additions and 35 deletions
|
|
@ -683,7 +683,7 @@ bool BlockManager::UndoWriteToDisk(const CBlockUndo& blockundo, FlatFilePos& pos
|
|||
fileout << GetParams().MessageStart() << nSize;
|
||||
|
||||
// Write undo data
|
||||
long fileOutPos = ftell(fileout.Get());
|
||||
long fileOutPos = fileout.tell();
|
||||
if (fileOutPos < 0) {
|
||||
LogError("%s: ftell failed\n", __func__);
|
||||
return false;
|
||||
|
|
@ -981,7 +981,7 @@ bool BlockManager::WriteBlockToDisk(const CBlock& block, FlatFilePos& pos) const
|
|||
fileout << GetParams().MessageStart() << nSize;
|
||||
|
||||
// Write block
|
||||
long fileOutPos = ftell(fileout.Get());
|
||||
long fileOutPos = fileout.tell();
|
||||
if (fileOutPos < 0) {
|
||||
LogError("%s: ftell failed\n", __func__);
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue