Add better logs, remove local seednode

This commit is contained in:
Manfred Karrer 2017-05-04 15:02:55 +02:00
parent dbd31a8746
commit 963494918d
3 changed files with 14 additions and 4 deletions

View File

@ -41,6 +41,7 @@ import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
// We are in UserThread context. We get callbacks from threaded classes which are already mapped to the UserThread.
@ -128,14 +129,23 @@ public class BsqLiteNode extends BsqNode {
}
// TODO use handler class
// server delivered 5 times the GetBsqBlocksResponse. after restart it was ok again.
// so issue is on fullnode side...
byte[] pastRequests;
private void onMessage(Msg msg, Connection connection) {
if (msg instanceof GetBsqBlocksResponse && connection.getPeersNodeAddressOptional().isPresent()) {
GetBsqBlocksResponse getBsqBlocksResponse = (GetBsqBlocksResponse) msg;
byte[] bsqBlocksBytes = getBsqBlocksResponse.getBsqBlocksBytes();
if (Arrays.equals(pastRequests, bsqBlocksBytes)) {
log.error("We got that message already. That should not happen.");
return;
}
pastRequests = bsqBlocksBytes;
List<BsqBlock> bsqBlockList = Utilities.<ArrayList<BsqBlock>>deserialize(bsqBlocksBytes);
log.info("received msg with {} items", bsqBlockList.size(), bsqBlockList.get(bsqBlockList.size() - 1).getHeight());
if (bsqBlockList.size() > 0)
log.info("block height of last item: ", bsqBlockList.get(bsqBlockList.size() - 1).getHeight());
log.info("block height of last item: {}", bsqBlockList.get(bsqBlockList.size() - 1).getHeight());
// Be safe and reset all mutable data in case the provider would not have done it
bsqBlockList.stream().forEach(BsqBlock::reset);
bsqLiteNodeExecutor.parseBsqBlocksForLiteNode(bsqBlockList,

View File

@ -88,8 +88,8 @@ public class BsqChainState implements Persistable {
// 0.3 BTC to alice: myjn5JVuQLN9S4QwGzY4VrD86819Zc2uhj
// 0.2BTC to bob: mx3xo655TAjC5r7ScuVEU8b6FMLomnKSeX
private static final String TEST_NET_GENESIS_TX_ID = "e360c3c77f43d53cbbf3dc8064c888a10310930a6427770ce4c8ead388edf17c";
private static final int TEST_NET_GENESIS_BLOCK_HEIGHT = 1119668;
private static final int TEST_NET_GENESIS_BLOCK_HEIGHT = 1119668;
// block 376078 has 2843 recursions and caused once a StackOverflowError, a second run worked. Took 1,2 sec.

View File

@ -26,7 +26,7 @@ public class SeedNodesRepository {
// DevFlags.STRESS_TEST_MODE ? new NodeAddress("hlitt7z4bec4kdh4.onion:8000") : new NodeAddress("23bnormzh2mvkz3z.onion:8000"),
// testnet
new NodeAddress("7qib4qu7h3qcox2r.onion:8001"),
/* new NodeAddress("7qib4qu7h3qcox2r.onion:8001"),*/
new NodeAddress("nbphlanpgbei4okt.onion:8001"),
// regtest