File tree Expand file tree Collapse file tree 3 files changed +3
-11
lines changed Expand file tree Collapse file tree 3 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -305,12 +305,3 @@ func (ln *LocalNode) bumpSeq() {
305
305
ln .seq ++
306
306
ln .db .storeLocalSeq (ln .id , ln .seq )
307
307
}
308
-
309
- // nowMilliseconds gives the current timestamp at millisecond precision.
310
- func nowMilliseconds () uint64 {
311
- ns := time .Now ().UnixNano ()
312
- if ns < 0 {
313
- return 0
314
- }
315
- return uint64 (ns / 1000 / 1000 )
316
- }
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import (
21
21
"net"
22
22
"net/netip"
23
23
"testing"
24
+ "time"
24
25
25
26
"github.com/ethereum/go-ethereum/crypto"
26
27
"github.com/ethereum/go-ethereum/p2p/enr"
@@ -53,7 +54,7 @@ func TestLocalNode(t *testing.T) {
53
54
54
55
// This test checks that the sequence number is persisted between restarts.
55
56
func TestLocalNodeSeqPersist (t * testing.T ) {
56
- timestamp := nowMilliseconds ( )
57
+ timestamp := uint64 ( time . Now (). UnixMilli () )
57
58
58
59
ln , db := newLocalNodeForTesting ()
59
60
defer db .Close ()
Original file line number Diff line number Diff line change @@ -434,7 +434,7 @@ func (db *DB) localSeq(id ID) uint64 {
434
434
if seq := db .fetchUint64 (localItemKey (id , dbLocalSeq )); seq > 0 {
435
435
return seq
436
436
}
437
- return nowMilliseconds ( )
437
+ return uint64 ( time . Now (). UnixMilli () )
438
438
}
439
439
440
440
// storeLocalSeq stores the local record sequence counter.
You can’t perform that action at this time.
0 commit comments