X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fmain.h;h=b1c78854a11fb7996cbc07cd4d80ea99962c11f4;hb=58ac600b2c94f12309fc5e18933891590dc1eb4c;hp=de674b5bb10e0a5cd75a1725e106bbcb365c57f5;hpb=774e9b6dbb2c967ec979351cc4dba82fc0102ee1;p=novacoin.git diff --git a/src/main.h b/src/main.h index de674b5..b1c7885 100644 --- a/src/main.h +++ b/src/main.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_MAIN_H #define BITCOIN_MAIN_H @@ -961,9 +961,10 @@ public: fileout << FLATDATA(pchMessageStart) << nSize; // Write block - nBlockPosRet = ftell(fileout); - if (nBlockPosRet == -1) + long fileOutPos = ftell(fileout); + if (fileOutPos < 0) return error("CBlock::WriteToDisk() : ftell failed"); + nBlockPosRet = fileOutPos; fileout << *this; // Flush stdio buffers and commit to disk before returning