Skip to content

Commit

Permalink
pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazar955 committed Sep 16, 2024
1 parent c7b5e6c commit 5a74287
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions submitter/relayer/relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (rl *Relayer) SendCheckpointToBTC(ckpt *ckpttypes.RawCheckpointWithMetaResp
return rl.store.PutCheckpoint(storedCkpt)
}

if rl.shouldSendCompleteCkpt(ckptEpoch) {
if rl.shouldSendCompleteCkpt(ckptEpoch) || rl.shouldSendTx2(ckptEpoch) {
hasBeenProcessed, err := maybeResendFromStore(
ckptEpoch,
rl.store.LatestCheckpoint,
Expand All @@ -114,7 +114,9 @@ func (rl *Relayer) SendCheckpointToBTC(ckpt *ckpttypes.RawCheckpointWithMetaResp
if hasBeenProcessed {
return nil
}
}

if rl.shouldSendCompleteCkpt(ckptEpoch) {
rl.logger.Infof("Submitting a raw checkpoint for epoch %v", ckptEpoch)

submittedCkpt, err := rl.convertCkptToTwoTxAndSubmit(ckpt.Ckpt)
Expand All @@ -131,20 +133,6 @@ func (rl *Relayer) SendCheckpointToBTC(ckpt *ckpttypes.RawCheckpointWithMetaResp

return nil
} else if rl.shouldSendTx2(ckptEpoch) {
hasBeenProcessed, err := maybeResendFromStore(
ckptEpoch,
rl.store.LatestCheckpoint,
rl.GetRawTransaction,
rl.sendTxToBTC,
)
if err != nil {
return err
}

if hasBeenProcessed {
return nil
}

rl.logger.Infof("Retrying to send tx2 for epoch %v, tx1 %s", ckptEpoch, rl.lastSubmittedCheckpoint.Tx1.TxId)
submittedCkpt, err := rl.retrySendTx2(ckpt.Ckpt)
if err != nil {
Expand Down

0 comments on commit 5a74287

Please sign in to comment.