Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nucleo
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Miguel Montes
nucleo
Commits
b8d741f4
Commit
b8d741f4
authored
6 years ago
by
Robert Martin-Legene
Browse files
Options
Downloads
Patches
Plain Diff
Small fixes to sealerwatch
parent
01d486b5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/sealerwatch.pl
+21
-6
21 additions, 6 deletions
bin/sealerwatch.pl
with
21 additions
and
6 deletions
bin/sealerwatch.pl
+
21
−
6
View file @
b8d741f4
...
...
@@ -382,21 +382,28 @@ sub colour_split
$col
.
substr
(
$name
,
1
)
.
ansi::
normal
();
}
my
$maxy
=
2
;
sub
presentation_top
{
my
$block
=
shift
;
return
if
not
defined
$block
;
#
my
$warning
=
'';
$warning
=
'
'
.
ansi::
red
()
.
"
**NOT RECENT**
"
.
ansi::
normal
()
if
$block
->
timestamp
+
1800
<
time
();
if
(
$block
->
timestamp
+
1800
<
time
()
)
{
$warning
=
'
'
.
ansi::
red
()
.
"
**NOT RECENT**
"
.
ansi::
normal
()
}
elsif
(
$block
->
timestamp
+
30
<
time
()
)
{
$warning
=
'
'
.
ansi::
bgyellow
()
.
ansi::
black
()
.
"
**NOT RECENT**
"
.
ansi::
normal
()
}
print
ansi::
CUP
(),
ansi::
normal
(),
tools::
gmt
(
$block
->
timestamp
),
$warning
,
ansi::
EL
(
0
),
ansi::
CUP
(
scalar
(
keys
%signers
)
+
2
,
1
);
ansi::
CUP
(
$maxy
,
1
);
}
while
(
defined
$block
||
sleep
1
)
...
...
@@ -414,7 +421,7 @@ while ( defined $block || sleep 1 )
$number
=
$block
->
number
;
if
(
exists
$cache
{
$number
-
1
}{'
block
'}
)
{
$parent
=
$cache
{
$number
-
1
}{'
block
'};
$parent
=
$cache
{
$number
-
1
}{'
block
'};
# If we do have any information about previous blocks,
# see if the hash matches. If we were in a side branch
# we would eventually get wrong hashes, because we
...
...
@@ -422,8 +429,15 @@ while ( defined $block || sleep 1 )
# This is a good way to determine if we're side tracked.
if
(
$parent
->
hash
ne
$block
->
parentHash
)
{
# First delete the signer of the to-be-forgotten block
# from the list of 'recent signs'. This will create a
# red 'n/a' to appear in the list. This is more desirable
# than finding the proper previous block of this signer,
# as it makes it more visual that a fork had happened.
my
$prevsigner
=
$cache
{
$number
-
1
}{'
signer
'};
delete
$signers
{
$prevsigner
};
# If we are side tracked, we'll read backwards
# until we find a match (or nothing cached)
# until we find a match (or
until we have
nothing cached)
delete
$cache
{
$number
};
$number
--
;
next
;
...
...
@@ -470,7 +484,8 @@ while ( defined $block || sleep 1 )
defined
$alias
?
$alias
:
'',
ansi::
EL
(
0
);
}
print
ansi::
ED
(
0
);
$maxy
=
scalar
(
keys
%
{
$result
->
{'
signers
'}
})
+
2
;
print
ansi::
ED
(
0
),
ansi::
CUP
(
$maxy
,
1
);
#
$number
=
$block
->
number
+
1
;
select
(
undef
,
undef
,
undef
,
0.2
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment