From 3d57e377a4e95941fd3f572b42e073b40d10d27c Mon Sep 17 00:00:00 2001 From: zelig Date: Sun, 12 Apr 2015 20:25:09 +0100 Subject: blockpool stability fixes: - follow up locks and fix them - chainManager: call SetQueued for parentErr future blocks, uncomment TD checks, unskip test - make ErrIncorrectTD non-fatal to be forgiving to genuine mistaken nodes (temp) but demote them to guard against stuck best peers. - add purging to bounded nodeCache (config nodeCacheSize) - use nodeCache when creating blockpool entries and let non-best peers add blocks (performance boost) - minor error in addError - reduce idleBestPeerTimeout to 1 minute - correct status counts and unskip status passing status test - glogified logging --- errs/errors.go | 9 +-------- errs/errors_test.go | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) (limited to 'errs') diff --git a/errs/errors.go b/errs/errors.go index 2e6c32494..face9b947 100644 --- a/errs/errors.go +++ b/errs/errors.go @@ -69,7 +69,7 @@ func (self *Errors) New(code int, format string, params ...interface{}) *Error { func (self Error) Error() (message string) { if len(message) == 0 { - self.message = fmt.Sprintf("[%s] %s", self.Package, self.Name) + self.message = fmt.Sprintf("[%s] ERROR: %s", self.Package, self.Name) if self.format != "" { self.message += ": " + fmt.Sprintf(self.format, self.params...) } @@ -81,15 +81,8 @@ func (self Error) Log(v glog.Verbose) { if v { v.Infoln(self) } - //log.Sendln(self.level, self) } -/* -func (self Error) Log(log *logger.Logger) { - log.Sendln(self.level, self) -} -*/ - /* err.Fatal() is true if err's severity level is 0 or 1 (logger.ErrorLevel or logger.Silence) */ diff --git a/errs/errors_test.go b/errs/errors_test.go index 09f70eef5..319093987 100644 --- a/errs/errors_test.go +++ b/errs/errors_test.go @@ -28,7 +28,7 @@ func testErrors() *Errors { func TestErrorMessage(t *testing.T) { err := testErrors().New(0, "zero detail %v", "available") message := fmt.Sprintf("%v", err) - exp := "[TEST] zero: zero detail available" + exp := "[TEST] ERROR: zero: zero detail available" if message != exp { t.Errorf("error message incorrect. expected %v, got %v", exp, message) } -- cgit