mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-24 23:12:31 +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
|
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 {
|
log.Tracef("outgoing '%s' message to %s: %s", message.Command(), c, logger.NewLogClosure(func() string {
|
||||||
return spew.Sdump(message)
|
return spew.Sdump(message)
|
||||||
}))
|
}))
|
||||||
@ -74,6 +75,7 @@ func (c *gRPCConnection) receiveLoop() error {
|
|||||||
return err
|
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 {
|
log.Tracef("incoming '%s' message from %s: %s", message.Command(), c, logger.NewLogClosure(func() string {
|
||||||
return spew.Sdump(message)
|
return spew.Sdump(message)
|
||||||
}))
|
}))
|
||||||
|
@ -25,7 +25,7 @@ func (f *FlowContext) StartIBDIfRequired() {
|
|||||||
|
|
||||||
atomic.StoreUint32(&f.isInIBD, 1)
|
atomic.StoreUint32(&f.isInIBD, 1)
|
||||||
f.ibdPeer = peer
|
f.ibdPeer = peer
|
||||||
peer.StartIBD()
|
spawn("StartIBDIfRequired-peer.StartIBD", peer.StartIBD)
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsInIBD is true if IBD is currently running
|
// IsInIBD is true if IBD is currently running
|
||||||
|
@ -2,6 +2,8 @@ package flowcontext
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/kaspanet/kaspad/logger"
|
"github.com/kaspanet/kaspad/logger"
|
||||||
|
"github.com/kaspanet/kaspad/util/panics"
|
||||||
)
|
)
|
||||||
|
|
||||||
var log, _ = logger.Get(logger.SubsystemTags.PROT)
|
var log, _ = logger.Get(logger.SubsystemTags.PROT)
|
||||||
|
var spawn = panics.GoroutineWrapperFunc(log)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user