Skip to content

Commit

Permalink
Update logging of connection details
Browse files Browse the repository at this point in the history
  • Loading branch information
galt-tr committed Jan 23, 2024
1 parent 2a1ab8b commit b143cf5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/models/alert_message_freeze_utxo.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ func (f *Fund) Serialize() []byte {
// Read reads the message
func (a *AlertMessageFreezeUtxo) Read(raw []byte) error {
if len(raw) < 57 {
return fmt.Errorf("freeze alert is less than 57 bytes, got %d bytes", len(raw))
return fmt.Errorf("freeze alert is less than 57 bytes, got %d bytes; raw: %x", len(raw), raw)
}
if len(raw)%57 != 0 {
return fmt.Errorf("freeze alert is not a multiple of 57 bytes, got %d bytes", len(raw))
return fmt.Errorf("freeze alert is not a multiple of 57 bytes, got %d bytes; raw: %x", len(raw), raw)
}
fundCount := len(raw) / 57
funds := []models.Fund{}
Expand Down
6 changes: 3 additions & 3 deletions app/p2p/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ func NewServer(o ServerOptions) (*Server, error) {

// Print out the peer ID and addresses
o.Config.Services.Log.Debugf("peer ID: %s", h.ID().String())
o.Config.Services.Log.Debug("connect to me on:")
o.Config.Services.Log.Info("connect to me on:")
for _, addr := range h.Addrs() {
o.Config.Services.Log.Debugf(" %s/p2p/%s", addr, h.ID().String())
o.Config.Services.Log.Infof(" %s/p2p/%s", addr, h.ID().String())
}

// Return the server
Expand Down Expand Up @@ -267,7 +267,7 @@ func (s *Server) discoverPeers(ctx context.Context, tn []string, routingDiscover

// Look for others who have announced and attempt to connect to them
connected := 0
for connected < 7 {
for connected < 2 {
for _, topicName := range tn {
s.config.Services.Log.Debugf("searching for peers for topic %s..\n", topicName)

Expand Down
6 changes: 3 additions & 3 deletions hack/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func main() {
a = InfoAlert(*sequenceNumber, "Testing block invalidation on testnet of 00000000000439a2c310b4e457f7e36f51c25931ccda8d512aeb2300587bcd5d", model.WithAllDependencies(_appConfig))
case models.AlertTypeInvalidateBlock:

a = InvalidateBlockAlert(*sequenceNumber, *blockHash, model.WithAllDependencies(_appConfig))
a = invalidateBlockAlert(*sequenceNumber, *blockHash, model.WithAllDependencies(_appConfig))
case models.AlertTypeBanPeer:
//a = BanPeerAlert(*sequenceNumber, *peer)
case models.AlertTypeUnbanPeer:
Expand Down Expand Up @@ -244,8 +244,8 @@ func UnbanPeerAlert(seq uint, peer string) alert.Alert {
return a
}
*/
// InvalidateBlockAlert creates an invalidate block alert
func InvalidateBlockAlert(seq uint, blockHash string, opts ...model.Options) *models.AlertMessage {
// invalidateBlockAlert creates an invalidate block alert
func invalidateBlockAlert(seq uint, blockHash string, opts ...model.Options) *models.AlertMessage {
hash, err := hex.DecodeString(blockHash)
if err != nil {
panic(err)
Expand Down

0 comments on commit b143cf5

Please sign in to comment.