An unused dirty block would put again into the unused list.
* This could cause bug #8123. While this fixes the crash, one underlying problem is still there, as dirty blocks should never leave a transaction.
This commit is contained in:
committed by
Axel Dörfler
parent
03aa456e2e
commit
8959a4e0c3
+3
-1
@@ -1268,7 +1268,7 @@ BlockWriter::_BlockDone(cached_block* block, hash_iterator* iterator)
|
|||||||
fDeletedTransaction = true;
|
fDeletedTransaction = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (block->transaction == NULL && block->ref_count == 0) {
|
if (block->transaction == NULL && block->ref_count == 0 && !block->unused) {
|
||||||
// the block is no longer used
|
// the block is no longer used
|
||||||
block->unused = true;
|
block->unused = true;
|
||||||
fCache->unused_blocks.Add(block);
|
fCache->unused_blocks.Add(block);
|
||||||
@@ -1761,7 +1761,9 @@ put_cached_block(block_cache* cache, cached_block* block)
|
|||||||
cache->RemoveBlock(block);
|
cache->RemoveBlock(block);
|
||||||
} else {
|
} else {
|
||||||
// put this block in the list of unused blocks
|
// put this block in the list of unused blocks
|
||||||
|
ASSERT(!block->unused);
|
||||||
block->unused = true;
|
block->unused = true;
|
||||||
|
|
||||||
ASSERT(block->original_data == NULL
|
ASSERT(block->original_data == NULL
|
||||||
&& block->parent_data == NULL);
|
&& block->parent_data == NULL);
|
||||||
cache->unused_blocks.Add(block);
|
cache->unused_blocks.Add(block);
|
||||||
|
|||||||
@@ -927,7 +927,7 @@ write_cached_block(block_cache* cache, cached_block* block,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (block->transaction == NULL && block->ref_count == 0) {
|
if (block->transaction == NULL && block->ref_count == 0 && !block->unused) {
|
||||||
// the block is no longer used
|
// the block is no longer used
|
||||||
block->unused = true;
|
block->unused = true;
|
||||||
cache->unused_blocks.Add(block);
|
cache->unused_blocks.Add(block);
|
||||||
|
|||||||
Reference in New Issue
Block a user