@@ -83,12 +83,12 @@ func (s *txScraper) pollOne(ctx context.Context, wg *sync.WaitGroup, tailer *txT
83
83
defer wg .Done ()
84
84
for {
85
85
isEnd , err := tailer .poll (ctx )
86
- if isEnd {
87
- break
88
- }
89
86
if err != nil {
90
87
s .log .Warn ("Failed to poll account txs" , zap .Error (err ))
91
88
}
89
+ if isEnd {
90
+ break
91
+ }
92
92
}
93
93
}
94
94
@@ -111,6 +111,9 @@ func newTxTailer(scraper *txScraper, pubkey solana.PublicKey) *txTailer {
111
111
}
112
112
113
113
func (t * txTailer ) refreshLastSig (ctx context.Context ) error {
114
+ t .log .Debug ("Getting latest sig" ,
115
+ zap .String ("publisher" , t .pubkeyStr ))
116
+
114
117
oneInt := 1
115
118
sigs , err := t .rpc .GetSignaturesForAddressWithOpts (ctx , t .pubkey , & rpc.GetSignaturesForAddressOpts {
116
119
Limit : & oneInt ,
@@ -121,10 +124,17 @@ func (t *txTailer) refreshLastSig(ctx context.Context) error {
121
124
metrics .RpcRequestsTotal .Inc ()
122
125
123
126
if len (sigs ) == 0 {
127
+ t .log .Debug ("Publisher has not sent any txs yet" ,
128
+ zap .String ("publisher" , t .pubkeyStr ))
124
129
return nil // empty account
125
130
}
126
131
t .lastSlot = sigs [0 ].Slot
127
132
t .lastSig = sigs [0 ].Signature
133
+
134
+ t .log .Debug ("Tailing txs starting at" ,
135
+ zap .String ("publisher" , t .pubkeyStr ),
136
+ zap .Stringer ("start_sig" , t .lastSig ))
137
+
128
138
return nil
129
139
}
130
140
0 commit comments