Commit fe474257 authored by inphi's avatar inphi

log errors in sub cb

parent 783252e6
...@@ -1241,15 +1241,17 @@ func (s *SyncService) syncTransactionFromQueue() error { ...@@ -1241,15 +1241,17 @@ func (s *SyncService) syncTransactionFromQueue() error {
tx types.Transaction tx types.Transaction
) )
if err := json.Unmarshal(msg.Data(), &txMeta); err != nil { if err := json.Unmarshal(msg.Data(), &txMeta); err != nil {
log.Error("Failed to unmarshal logged TransactionMeta", "msg", err)
msg.Nack() msg.Nack()
return return
} }
if err := rlp.DecodeBytes(txMeta.RawTransaction, &tx); err != nil { if err := rlp.DecodeBytes(txMeta.RawTransaction, &tx); err != nil {
log.Error("decoding raw transaction failed", "msg", err)
msg.Nack() msg.Nack()
return return
} }
if txMeta.L1BlockNumber == nil || txMeta.L1Timestamp == 0 { if txMeta.L1BlockNumber == nil || txMeta.L1Timestamp == 0 {
log.Warn("missing required queued transaction fields", "msg", string(msg.Data())) log.Error("Missing required queued transaction fields", "msg", string(msg.Data()))
msg.Nack() msg.Nack()
return return
} }
...@@ -1260,6 +1262,7 @@ func (s *SyncService) syncTransactionFromQueue() error { ...@@ -1260,6 +1262,7 @@ func (s *SyncService) syncTransactionFromQueue() error {
} }
if err := s.applyTransactionToTip(&tx); err != nil { if err := s.applyTransactionToTip(&tx); err != nil {
log.Error("Unable to apply transactions to tip from Queue", "msg", err)
msg.Nack() msg.Nack()
return return
} }
...@@ -1267,6 +1270,7 @@ func (s *SyncService) syncTransactionFromQueue() error { ...@@ -1267,6 +1270,7 @@ func (s *SyncService) syncTransactionFromQueue() error {
msg.Ack() msg.Ack()
} }
// This blocks until there's a new message in the queue or ctx deadline hits
s.queueSub.ReceiveMessage(s.ctx, cb) s.queueSub.ReceiveMessage(s.ctx, cb)
return nil return nil
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment