Skip to content

Commit

Permalink
ticketvote: Remove testnet linkby path.
Browse files Browse the repository at this point in the history
This diff removes a testnet code path that allowed a runoff vote to
start prior to the linkby deadline expiring. It was suppose to make
testing easier, but it is causing bugs so its being removed. Having a
testnet code path was a bad idea.
  • Loading branch information
lukebp authored Apr 6, 2021
1 parent f88eee7 commit ddc9ed9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
15 changes: 3 additions & 12 deletions politeiad/backendv2/tstorebe/plugins/ticketvote/cmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -752,22 +752,13 @@ func (p *ticketVotePlugin) startRunoffForParent(token []byte, s ticketvote.Start
"parent", token),
}
}
isExpired := vm.LinkBy < time.Now().Unix()
isMainNet := p.activeNetParams.Name == chaincfg.MainNetParams().Name
switch {
case !isExpired && isMainNet:
if vm.LinkBy > time.Now().Unix() {
return nil, backend.PluginError{
PluginID: ticketvote.PluginID,
ErrorCode: uint32(ticketvote.ErrorCodeLinkByNotExpired),
ErrorContext: fmt.Sprintf("parent record %x linkby "+
"deadline not met %v", token, vm.LinkBy),
}
case !isExpired:
// Allow the vote to be started before the link by deadline
// expires on testnet and simnet only. This makes testing the
// runoff vote process easier.
log.Warnf("Parent record linkby deadline has not been met; " +
"disregarding deadline since this is not mainnet")
"deadline (%v) has not expired yet", token, vm.LinkBy),
}
}

// Compile a list of the expected submissions that should be in the
Expand Down
2 changes: 1 addition & 1 deletion politeiawww/cmd/pictl/cmdvotetestsetup.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (c *cmdVoteTestSetup) Execute(args []string) error {
return err
}
if policyWWW.PaywallEnabled {
return fmt.Errorf("paywall is not disabled")
fmt.Printf("WARN: politeiawww paywall is not disabled\n")
}

// Setup votes
Expand Down

0 comments on commit ddc9ed9

Please sign in to comment.