mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
[NOD-1206] Call peer.StartIBD in new goroutine (#833)
This commit is contained in:
parent
211c4d05e8
commit
94f617b06a
@ -41,6 +41,7 @@ func (c *gRPCConnection) sendLoop() error {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Debugf("outgoing '%s' message to %s", message.Command(), c)
|
||||
log.Tracef("outgoing '%s' message to %s: %s", message.Command(), c, logger.NewLogClosure(func() string {
|
||||
return spew.Sdump(message)
|
||||
}))
|
||||
@ -74,6 +75,7 @@ func (c *gRPCConnection) receiveLoop() error {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Debugf("incoming '%s' message from %s", message.Command(), c)
|
||||
log.Tracef("incoming '%s' message from %s: %s", message.Command(), c, logger.NewLogClosure(func() string {
|
||||
return spew.Sdump(message)
|
||||
}))
|
||||
|
@ -25,7 +25,7 @@ func (f *FlowContext) StartIBDIfRequired() {
|
||||
|
||||
atomic.StoreUint32(&f.isInIBD, 1)
|
||||
f.ibdPeer = peer
|
||||
peer.StartIBD()
|
||||
spawn("StartIBDIfRequired-peer.StartIBD", peer.StartIBD)
|
||||
}
|
||||
|
||||
// IsInIBD is true if IBD is currently running
|
||||
|
@ -2,6 +2,8 @@ package flowcontext
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/logger"
|
||||
"github.com/kaspanet/kaspad/util/panics"
|
||||
)
|
||||
|
||||
var log, _ = logger.Get(logger.SubsystemTags.PROT)
|
||||
var spawn = panics.GoroutineWrapperFunc(log)
|
||||
|
Loading…
x
Reference in New Issue
Block a user