|
|
@ -34,12 +34,12 @@ import tech.pegasys.pantheon.ethereum.rlp.RLPException; |
|
|
|
import tech.pegasys.pantheon.util.bytes.BytesValue; |
|
|
|
import tech.pegasys.pantheon.util.bytes.BytesValue; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
|
|
|
|
import java.util.Collection; |
|
|
|
import java.util.Collection; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Optional; |
|
|
|
import java.util.Optional; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.google.common.collect.Lists; |
|
|
|
import org.apache.logging.log4j.LogManager; |
|
|
|
import org.apache.logging.log4j.LogManager; |
|
|
|
import org.apache.logging.log4j.Logger; |
|
|
|
import org.apache.logging.log4j.Logger; |
|
|
|
|
|
|
|
|
|
|
@ -135,8 +135,8 @@ class EthServer { |
|
|
|
if (firstHeader == null) { |
|
|
|
if (firstHeader == null) { |
|
|
|
resp = Collections.emptyList(); |
|
|
|
resp = Collections.emptyList(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
resp = new ArrayList<>(Arrays.asList(firstHeader)); |
|
|
|
resp = Lists.newArrayList(firstHeader); |
|
|
|
final int numberDelta = reversed ? -(skip + 1) : (skip + 1); |
|
|
|
final long numberDelta = reversed ? -(skip + 1) : (skip + 1); |
|
|
|
for (int i = 1; i < maxHeaders; i++) { |
|
|
|
for (int i = 1; i < maxHeaders; i++) { |
|
|
|
final long blockNumber = firstHeader.getNumber() + i * numberDelta; |
|
|
|
final long blockNumber = firstHeader.getNumber() + i * numberDelta; |
|
|
|
if (blockNumber < BlockHeader.GENESIS_BLOCK_NUMBER) { |
|
|
|
if (blockNumber < BlockHeader.GENESIS_BLOCK_NUMBER) { |
|
|
|