Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Initialize age of vault to 4 instead of 1
  • Loading branch information
iancoleman committed Jan 7, 2018
1 parent edf7aff commit 0cb051a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/safenet/section.go
Expand Up @@ -45,7 +45,7 @@ func (s *Section) addVault(v *Vault) (*NetworkEvent, bool) {
// complete (all elders are adults)
// see https://github.com/fizyk20/ageing_sim/blob/53829350daa372731c9b8080488b2a75c72f60bb/src/network/section.rs#L198
isDisallowed := false
//if v.Age == 1 && s.hasVaultAgedOne() && s.isComplete() {
//if v.Age == 4 && s.hasVaultAgedFour() && s.isComplete() {
// isDisallowed = true
// return nil, isDisallowed
//}
Expand Down Expand Up @@ -119,9 +119,9 @@ func (s *Section) isComplete() bool {
return s.TotalAdults() >= GroupSize
}

func (s *Section) hasVaultAgedOne() bool {
func (s *Section) hasVaultAgedFour() bool {
for _, v := range s.Vaults {
if v.Age == 1 {
if v.Age == 4 {
return true
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/safenet/vault.go
Expand Up @@ -14,7 +14,7 @@ type Vault struct {
func NewVault() *Vault {
return &Vault{
Name: NewXorName(),
Age: 1,
Age: 4,
}
}

Expand Down

0 comments on commit 0cb051a

Please sign in to comment.