nil-ThrottleTimer.Stop() does nothing

This commit is contained in:
Jae Kwon
2015-07-20 17:26:22 -07:00
parent 3a9b465c75
commit f51cfc03ea
2 changed files with 7 additions and 2 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ install:
go install github.com/tendermint/tendermint/cmd/debora
go install github.com/tendermint/tendermint/cmd/stdinwriter
go install github.com/tendermint/tendermint/cmd/logjack
@echo -n `git rev-parse --verify HEAD` > $(TMROOT)/revisions
@echo -n `git rev-parse --verify HEAD` >> $(TMROOT)/revisions
build:
go build -o build/tendermint github.com/tendermint/tendermint/cmd/tendermint
@@ -48,4 +48,4 @@ gen_client:
go generate rpc/core_client/*.go
revision:
@echo -n `git rev-parse --verify HEAD` > $(TMROOT)/revisions
@echo -n `git rev-parse --verify HEAD` >> $(TMROOT)/revisions
+5
View File
@@ -46,7 +46,12 @@ func (t *ThrottleTimer) Set() {
}
}
// For ease of .Stop()'ing services before .Start()'ing them,
// we ignore .Stop()'s on nil ThrottleTimers
func (t *ThrottleTimer) Stop() bool {
if t == nil {
return false
}
close(t.quit)
return t.timer.Stop()
}