Skip to content

Commit 6deb80f

Browse files
authored
Np/debug (#265)
* debug logs * more debug logs
1 parent b008c5c commit 6deb80f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

internal/publisher/publisher.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"crypto/tls"
66
"encoding/json"
77
"fmt"
8-
"math/rand/v2"
98
"net"
109
"strings"
1110
"sync"
@@ -98,9 +97,18 @@ func (p *Publisher) initialize() error {
9897
}
9998

10099
func (p *Publisher) PublishBlockData(blockData []common.BlockData) error {
101-
if rand.Float32() < 0.3 {
102-
log.Debug().Msgf("Publishing %d block data", len(blockData))
100+
for _, data := range blockData {
101+
for _, tx := range data.Transactions {
102+
if strings.ToLower(tx.ToAddress) == "0x9c868614ffca7da36b36330b1f317b117c7834de" {
103+
log.Debug().Msgf("Publising block has txn hash %s", tx.Hash)
104+
}
105+
}
103106
}
107+
log.Debug().
108+
Any("startBlockNumber", blockData[0].Block.Number.Uint64()).
109+
Any("endBlockNumber", blockData[len(blockData)-1].Block.Number.Uint64()).
110+
Msgf("Publishing %d block data", len(blockData))
111+
104112
return p.publishBlockData(blockData, false)
105113
}
106114

0 commit comments

Comments
 (0)