Added Status method to network.Node fixed random segfaults.

This commit is contained in:
Milos Gajdos
2020-01-14 18:12:36 +00:00
parent 994d371ff1
commit 821fda41ae
7 changed files with 432 additions and 84 deletions

View File

@@ -26,6 +26,20 @@ var (
PruneTime = 90 * time.Second
)
// Error is network node errors
type Error interface {
// Count is current count of errors
Count() int
// Msg is last error message
Msg() string
}
// Status is node status
type Status interface {
// Error reports error status
Error() Error
}
// Node is network node
type Node interface {
// Id is node id
@@ -36,6 +50,8 @@ type Node interface {
Peers() []Node
// Network is the network node is in
Network() Network
// Status returns node status
Status() Status
}
// Network is micro network