Use Genesis.getHash() again instead of static value
This commit is contained in:
parent
2f73b98614
commit
b69c355dba
|
@ -3,23 +3,18 @@ package org.ethereum.manager;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import org.ethereum.core.Block;
|
import org.ethereum.core.Block;
|
||||||
import org.ethereum.core.Genesis;
|
import org.ethereum.core.Genesis;
|
||||||
import org.ethereum.core.Transaction;
|
import org.ethereum.core.Transaction;
|
||||||
import org.ethereum.core.Wallet;
|
import org.ethereum.core.Wallet;
|
||||||
import org.ethereum.crypto.HashUtil;
|
import org.ethereum.crypto.HashUtil;
|
||||||
import org.ethereum.geodb.IpGeoDB;
|
|
||||||
import org.ethereum.net.client.ClientPeer;
|
import org.ethereum.net.client.ClientPeer;
|
||||||
import org.ethereum.net.client.PeerData;
|
import org.ethereum.net.client.PeerData;
|
||||||
import org.ethereum.net.message.StaticMessages;
|
import org.ethereum.net.message.StaticMessages;
|
||||||
import org.spongycastle.util.encoders.Hex;
|
import org.spongycastle.util.encoders.Hex;
|
||||||
|
|
||||||
import com.maxmind.geoip.Location;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* www.ethereumJ.com
|
* www.ethereumJ.com
|
||||||
* User: Roman Mandeleil
|
* User: Roman Mandeleil
|
||||||
|
@ -91,9 +86,8 @@ public class MainData {
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] getLatestBlockHash(){
|
public byte[] getLatestBlockHash(){
|
||||||
|
|
||||||
if (blockChainDB.isEmpty())
|
if (blockChainDB.isEmpty())
|
||||||
return StaticMessages.GENESIS_HASH;
|
return (new Genesis()).getHash();
|
||||||
else
|
else
|
||||||
return blockChainDB.get(blockChainDB.size() - 1).getHash();
|
return blockChainDB.get(blockChainDB.size() - 1).getHash();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue