From 4c66a72410e386f9574207766e89c59a8d64135c Mon Sep 17 00:00:00 2001 From: "decauwsemaecker.glen@gmail.com" Date: Fri, 7 Apr 2017 15:12:22 -0500 Subject: [PATCH] add more logging to consensus code --- consensus.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/consensus.go b/consensus.go index bb747a2..8f7a1c3 100644 --- a/consensus.go +++ b/consensus.go @@ -81,9 +81,11 @@ type Consensus struct { // the weight has to be of a value of 1 or above. func (c *Consensus) AddVoter(source Source, weight uint) error { if source == nil { + c.logger.Println("[ERROR] could not add voter: no source given") return ErrNoSource } if weight == 0 { + c.logger.Println("[ERROR] could not add voter: weight cannot be 0") return ErrInsufficientWeight } @@ -125,6 +127,7 @@ func (c *Consensus) ExternalIP() (net.IP, error) { // if no votes were casted succesfully, // return early with an error if len(voteCollection) == 0 { + c.logger.Println("[ERROR] no votes were casted succesfully") return nil, ErrNoIP }