Compare commits
1 Commits
dragonx
...
ibd-wallet
| Author | SHA1 | Date | |
|---|---|---|---|
| 2f3f320d28 |
@@ -179,6 +179,13 @@ void ThreadNotifyWallets(CBlockIndex *pindexLastTip)
|
||||
// Read block from disk.
|
||||
CBlock block;
|
||||
if (!ReadBlockFromDisk(block, pindexLastTip,1)) {
|
||||
if (IsInitialBlockDownload()) {
|
||||
// During IBD, block data may not be flushed to disk yet.
|
||||
// Sleep briefly and retry on the next cycle instead of crashing.
|
||||
LogPrintf("%s: block at height %d not yet readable, will retry\n",
|
||||
__func__, pindexLastTip->GetHeight());
|
||||
break;
|
||||
}
|
||||
LogPrintf("*** %s\n", "Failed to read block while notifying wallets of block disconnects");
|
||||
uiInterface.ThreadSafeMessageBox(
|
||||
_("Error: A fatal internal error occurred, see debug.log for details"),
|
||||
@@ -206,6 +213,14 @@ void ThreadNotifyWallets(CBlockIndex *pindexLastTip)
|
||||
// Read block from disk.
|
||||
CBlock block;
|
||||
if (!ReadBlockFromDisk(block, blockData.pindex, 1)) {
|
||||
if (IsInitialBlockDownload()) {
|
||||
// During IBD, block data may not be flushed to disk yet.
|
||||
// Push unprocessed blocks back and retry on the next cycle.
|
||||
LogPrintf("%s: block at height %d not yet readable, will retry\n",
|
||||
__func__, blockData.pindex->GetHeight());
|
||||
blockStack.push_back(blockData);
|
||||
break;
|
||||
}
|
||||
LogPrintf("*** %s\n", "Failed to read block while notifying wallets of block connects");
|
||||
uiInterface.ThreadSafeMessageBox(
|
||||
_("Error: A fatal internal error occurred, see debug.log for details"),
|
||||
|
||||
Reference in New Issue
Block a user