Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
contrib
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Rafael Bidegain
contrib
Commits
7ac17cce
Commit
7ac17cce
authored
6 years ago
by
Miguel Montes
Browse files
Options
Downloads
Patches
Plain Diff
Corrección de bug en código de votación (no votaba si estaba en Tally)
parent
a6a9b4e8
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
bfa_client/src/client/bfa_client.go
+9
-15
9 additions, 15 deletions
bfa_client/src/client/bfa_client.go
with
9 additions
and
15 deletions
bfa_client/src/client/bfa_client.go
+
9
−
15
View file @
7ac17cce
...
...
@@ -331,19 +331,18 @@ func propose() {
defer
node
.
Close
()
util
.
Ensure
(
node
.
IsSealer
(
bfa
.
Self
),
"Solo los selladores pueden votar"
)
votes
:=
node
.
Votes
(
latest
)
util
.
Ensure
(
flags
.
NArg
()
>
0
,
"No se especificaron candidatos por los cuales votar"
)
util
.
Ensure
(
flags
.
NArg
()
>
0
,
"No se especificaron candidatos por los cuales votar
\n
"
)
for
i
:=
0
;
i
<
flags
.
NArg
();
i
++
{
address
:=
flags
.
Arg
(
i
)
util
.
Ensure
(
util
.
IsAddress
(
address
),
"'%v' no es una dirección válida"
,
address
)
if
_
,
ok
:=
votes
.
Tally
[
address
];
ok
{
continue
// address is in a proposal, so we allow voting either way
}
isSealer
:=
util
.
Contains
(
votes
.
Signers
,
address
)
switch
{
// address is not in a proposal, we allow removing signers or adding non signers
case
isSealer
&&
authorize
:
util
.
Error
(
"'%v' ya es un sellador"
,
address
)
case
!
isSealer
&&
!
authorize
:
util
.
Error
(
"'%v' no es un sellador"
,
address
)
if
_
,
ok
:=
votes
.
Tally
[
address
];
!
ok
{
isSealer
:=
util
.
Contains
(
votes
.
Signers
,
address
)
switch
{
// address is not in a proposal, we only allow removing signers or adding non signers
case
isSealer
&&
authorize
:
util
.
Error
(
"'%v' ya es un sellador"
,
address
)
case
!
isSealer
&&
!
authorize
:
util
.
Error
(
"'%v' no es un sellador"
,
address
)
}
}
node
.
Propose
(
address
,
authorize
)
if
json
{
...
...
@@ -448,11 +447,6 @@ func main() {
validCommands
=
append
(
validCommands
,
cmd
)
}
sort
.
Strings
(
validCommands
)
//defer func() {
// if err := recover(); err != nil {
// log.Printf("Error: %s", err)
// }
//}()
if
len
(
os
.
Args
)
>
1
{
command
=
commands
[
os
.
Args
[
1
]]
}
...
...
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