mirror of
https://github.com/Qortal/qortal.git
synced 2025-03-14 19:42:32 +00:00
Handle case when attempting to load a block from the archive by reference, but the referenced block is in the main block repository, not the archive. This is the case with the genesis block.
Should fix issue where no block summaries were returned when syncing from block 1
This commit is contained in:
parent
d00fce86d2
commit
dedc8d89c7
@ -71,6 +71,10 @@ public class HSQLDBBlockArchiveRepository implements BlockArchiveRepository {
|
||||
@Override
|
||||
public BlockData fromReference(byte[] reference) throws DataException {
|
||||
BlockData referenceBlock = this.repository.getBlockArchiveRepository().fromSignature(reference);
|
||||
if (referenceBlock == null) {
|
||||
// Try the main block repository. Needed for genesis block.
|
||||
referenceBlock = this.repository.getBlockRepository().fromSignature(reference);
|
||||
}
|
||||
if (referenceBlock != null) {
|
||||
int height = referenceBlock.getHeight();
|
||||
if (height > 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user