Search in sources :

Example 21 with BlockIdentifier

use of org.ethereum.core.BlockIdentifier in project rskj by rsksmart.

the class NewBlockHashesMessage method encode.

private void encode() {
    List<byte[]> encodedElements = new ArrayList<>();
    for (BlockIdentifier identifier : blockIdentifiers) {
        encodedElements.add(identifier.getEncoded());
    }
    byte[][] encodedElementArray = encodedElements.toArray(new byte[encodedElements.size()][]);
    this.encoded = RLP.encodeList(encodedElementArray);
}
Also used : BlockIdentifier(org.ethereum.core.BlockIdentifier) ArrayList(java.util.ArrayList)

Aggregations

BlockIdentifier (org.ethereum.core.BlockIdentifier)21 Block (org.ethereum.core.Block)14 Test (org.junit.Test)10 TestSystemProperties (co.rsk.config.TestSystemProperties)6 SimplePeer (co.rsk.net.simples.SimplePeer)5 SyncConfiguration (co.rsk.net.sync.SyncConfiguration)5 BlockChainBuilder (co.rsk.test.builders.BlockChainBuilder)5 Blockchain (org.ethereum.core.Blockchain)5 RskSystemProperties (co.rsk.config.RskSystemProperties)4 java.util (java.util)4 Collectors (java.util.stream.Collectors)4 Nonnull (javax.annotation.Nonnull)4 Transaction (org.ethereum.core.Transaction)4 Logger (org.slf4j.Logger)4 LoggerFactory (org.slf4j.LoggerFactory)4 NodeID (co.rsk.net.NodeID)3 co.rsk.net.messages (co.rsk.net.messages)3 VisibleForTesting (com.google.common.annotations.VisibleForTesting)3 TimeUnit (java.util.concurrent.TimeUnit)3 Nullable (javax.annotation.Nullable)3