Skip to content

Commit 2dedc15

Browse files
committed
fix: monitor tx timestamp
1 parent 8e0b8fa commit 2dedc15

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/l2.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,9 @@ func (l2 *L2) sendProbeTx(ctx context.Context) {
701701

702702
tryingNonces:
703703
for attempt := 1; attempt <= 8; attempt++ { // we don't want to get rate-limited
704+
thisBlock := time.Now().Add(-l2.cfg.BlockTime / 2).Round(l2.cfg.BlockTime)
705+
binary.BigEndian.PutUint64(data, uint64(thisBlock.Unix()))
706+
704707
tx := ethtypes.NewTransaction(
705708
l2.nonce,
706709
ethcommon.Address{},
@@ -710,9 +713,6 @@ tryingNonces:
710713
data,
711714
)
712715

713-
thisBlock := time.Now().Add(-l2.cfg.BlockTime / 2).Round(l2.cfg.BlockTime)
714-
binary.BigEndian.PutUint64(data, uint64(thisBlock.Unix()))
715-
716716
signedTx, err := ethtypes.SignTx(tx, l2.signer, l2.monitorKey)
717717
if err != nil {
718718
l.Error("Failed to sign a transaction",

0 commit comments

Comments
 (0)