Skip to content

Commit

Permalink
dirty patch
Browse files Browse the repository at this point in the history
  • Loading branch information
iulianpascalau committed Dec 5, 2019
1 parent 844bb2a commit 67a4d00
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package topicResolverSender

import (
"github.com/ElrondNetwork/elrond-go/dataRetriever"
"github.com/ElrondNetwork/elrond-go/logger"
"github.com/ElrondNetwork/elrond-go/marshal"
"github.com/ElrondNetwork/elrond-go/p2p"
)
Expand All @@ -12,6 +13,8 @@ const topicRequestSuffix = "_REQUEST"
// NumPeersToQuery number of peers to send the message
const NumPeersToQuery = 2

var log = logger.GetOrCreate("dataretriever/resolvers")

type topicResolverSender struct {
messenger dataRetriever.MessageHandler
marshalizer marshal.Marshalizer
Expand Down Expand Up @@ -83,6 +86,7 @@ func (trs *topicResolverSender) SendOnRequestTopic(rd *dataRetriever.RequestData

err = trs.messenger.SendToConnectedPeer(topicToSendRequest, buff, peer)
if err != nil {
log.Debug("request error", "error", err.Error(), "topic", trs.topicName)
continue
}

Expand Down
9 changes: 9 additions & 0 deletions p2p/libp2p/netMessenger.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,15 @@ func createMessenger(
time.Sleep(durationBetweenSends)
}
}(pb, netMes.outgoingPLB)
go func() {
for {
time.Sleep(time.Second * 20)

log.Debug("network connection status",
"connected peers", len(netMes.Peers()),
)
}
}()

addresses := make([]interface{}, 0)
for i, address := range netMes.ctxProvider.Host().Addrs() {
Expand Down
16 changes: 16 additions & 0 deletions process/sync/baseSync.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package sync

import (
"bytes"
"encoding/hex"
"fmt"
"math"
"sync"
Expand Down Expand Up @@ -727,6 +728,21 @@ func (boot *baseBootstrap) getNextHeaderRequestingIfMissing() (data.HeaderHandle
hash = boot.forkInfo.Hash
}

if boot.shardCoordinator.SelfId() == 1 {
switch nonce {
case 2897:
hash, _ = hex.DecodeString("75b2697dc7148975d5b0ff8f67ff84955469901949b2f45da723bb50ca5b68d9")
case 2898:
hash, _ = hex.DecodeString("b46f71620fba96ac0fec71cef2a54769acc8e66c2ae95e1c2942cd4b1909af6b")
case 2899:
hash, _ = hex.DecodeString("3cda7b8049714a21af3dfd02a79e454fc19393757adb8c01c8bb45d0124514b6")
case 2900:
hash, _ = hex.DecodeString("ce0be06e7186324d7ad4def28c6a5967c29f10d174c1b9b3a35363239be82e54")
case 2901:
hash, _ = hex.DecodeString("100d8e4367c6bec3cb65eb940f6409303f1e970b960795ed6f774812bf83833c")
}
}

if hash != nil {
return boot.blockBootstrapper.getHeaderWithHashRequestingIfMissing(hash)
}
Expand Down

0 comments on commit 67a4d00

Please sign in to comment.