Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error handling during validation #2224

merged 5 commits into from Jan 30, 2013
Changes from 1 commit
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.


Just for now

Add disk space checks before flushing CCoins cache

  • Loading branch information
sipa authored and Pieter Wuille committed Jan 26, 2013
commit 18379c80874ad6f4fa0e962dd2046e2fa7ecd287
@@ -1806,6 +1806,13 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)
// Make sure it's successfully written to disk before changing memory structure
bool fIsInitialDownload = IsInitialBlockDownload();
if (!fIsInitialDownload || pcoinsTip->GetCacheSize() > nCoinCacheSize) {
// Typical CCoins structures on disk are around 100 bytes in size.
// Pushing a new one to the database can cause it to be written
// twice (once in the log, and once in the tables). This is already
// an overestimation, as most will delete an existing entry or
// overwrite one. Still, use a conservative safety factor of 2.
if (!CheckDiskSpace(100 * 2 * 2 * pcoinsTip->GetCacheSize()))
return state.Error();
if (!pcoinsTip->Flush())
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.