aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-04-05 11:29:41 +0800
committerJimmy Hu <jimmy.hu@dexon.org>2019-04-25 14:59:36 +0800
commita64ac7f81e75c64467e786c7d06e809575c70be5 (patch)
treea203dc2bb1fce00ccf41331c96436c5cbb831776
parent2e9c8ba3bb00b23eae3b84d1590cec6b12d99293 (diff)
downloaddexon-taipei.tar.gz
dexon-taipei.tar.zst
dexon-taipei.zip
add logtaipei
-rw-r--r--vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go
index a1def58e0..2e457d026 100644
--- a/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go
+++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go
@@ -1227,8 +1227,13 @@ func (con *Consensus) deliverNetworkMsg() {
func (con *Consensus) processMsg() {
defer con.waitGroup.Done()
+ ch := make(chan struct{})
+ go func() {
+ <-ch
+ }()
MessageLoop:
for {
+ ch <- struct{}{}
select {
case <-con.ctx.Done():
return
@@ -1248,6 +1253,16 @@ MessageLoop:
return
}
}
+
+ start := time.Now()
+ go func(start time.Time, msg interface{}) {
+ <-ch
+ if time.Since(start) > 1*time.Millisecond {
+ con.logger.Debug("Consensus core handling message",
+ "time", time.Since(start),
+ "msg", msg)
+ }
+ }(start, msg)
switch val := msg.(type) {
case *selfAgreementResult:
con.baMgr.touchAgreementResult((*types.AgreementResult)(val))