Skip to content

Uptime in "show state" resets on each execution #949

@belane

Description

@belane

The show state command shows an uptime that resets each time the command is executed, instead of the actual node uptime or system uptime.

Looks that in MainService.Node.cs, the DisplayState class initializes StartTime with DateTime.UtcNow each time, instead of the node's start time.
https://github.com/neo-project/neo-node/blob/master/src/Neo.CLI/CLI/MainService.Node.cs#L101

One possible solution could be to use the actual process start time:

public DisplayState()
{
    StartTime = Process.GetCurrentProcess().StartTime.ToUniversalTime();
    // ...
}

This will display the real node uptime and won't reset when executing the command multiple times.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions