Skip to content

Commit

Permalink
Merged in coinplugin/go-metadium (pull request #17)
Browse files Browse the repository at this point in the history
Master

Approved-by: Uh Sado <[email protected]>
  • Loading branch information
sadoci committed Mar 16, 2019
2 parents f34532f + f20def8 commit b9a17c4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions metadium/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func (ma *metaAdmin) getMinerNodes(height int, locked bool) (*metaNode, *metaNod
})

for _, n := range nodes {
if (ma.self != nil && n.Id == ma.self.Id) || ma.isPeerUp(n.Idv4) {
if (ma.self != nil && n.Id == ma.self.Id) || ma.isPeerUp(n.Id) {
n.Status = "up"
} else {
n.Status = "down"
Expand Down Expand Up @@ -1246,12 +1246,12 @@ func getMiners(id string, timeout int) []*metaapi.MetadiumMinerStatus {
if admin.self != nil && admin.self.Id == node.Id {
miners = append(miners, getMinerStatus())
return miners
} else if !admin.isPeerUp(node.Idv4) {
} else if !admin.isPeerUp(node.Id) {
miners = append(miners, getDownStatus(node))
return miners
}

err = admin.rpcCli.CallContext(ctx, nil, "admin_requestMinerStatus", &node.Idv4)
err = admin.rpcCli.CallContext(ctx, nil, "admin_requestMinerStatus", &node.Id)
if err != nil {
log.Error("Metadium RequestMinerStatus Failed", "id", node.Id, "error", err)
status := getDownStatus(node)
Expand All @@ -1266,12 +1266,12 @@ func getMiners(id string, timeout int) []*metaapi.MetadiumMinerStatus {
if admin.self != nil && admin.self.Id == n.Id {
miners = append(miners, getMinerStatus())
continue
} else if !admin.isPeerUp(n.Idv4) {
} else if !admin.isPeerUp(n.Id) {
miners = append(miners, getDownStatus(n))
continue
}

err = admin.rpcCli.CallContext(ctx, nil, "admin_requestMinerStatus", n.Idv4)
err = admin.rpcCli.CallContext(ctx, nil, "admin_requestMinerStatus", n.Id)
if err != nil {
status := getDownStatus(n)
status.RttMs = big.NewInt((time.Now().UnixNano() - startTime) / 1000000)
Expand Down
4 changes: 2 additions & 2 deletions metadium/etcdutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func (ma *metaAdmin) etcdJoin(name string) error {

timer := time.NewTimer(30 * time.Second)
ctx, cancel := context.WithCancel(context.Background())
err := admin.rpcCli.CallContext(ctx, nil, "admin_requestEtcdAddMember", &node.Idv4)
err := admin.rpcCli.CallContext(ctx, nil, "admin_requestEtcdAddMember", &node.Id)
cancel()
if err != nil {
log.Error("Metadium admin_requestEtcdAddMember failed", "id", node.Id, "error", err)
Expand Down Expand Up @@ -547,7 +547,7 @@ func EtcdStart() {
}
admin.lock.Unlock()

if node != nil && admin.isPeerUp(node.Idv4) {
if node != nil && admin.isPeerUp(node.Id) {
log.Info("Metadium", "Trying to join", node.Name)
admin.etcdJoin(node.Name)
}
Expand Down
4 changes: 2 additions & 2 deletions vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -1271,8 +1271,8 @@
{
"checksumSHA1": "vKbPb9fpjCdzuoOvajOJnYfHG2g=",
"path": "golang.org/x/crypto/poly1305",
"revision": "e3636079e1a4c1f337f212cc5cd2aca108f6c900",
"revisionTime": "2018-09-26T22:24:25Z"
"revision": "ff983b9c42bc9fbf91556e191cc8efb585c16908",
"revisionTime": "2018-07-25T11:53:45Z"
},
{
"checksumSHA1": "vKbPb9fpjCdzuoOvajOJnYfHG2g=",
Expand Down

0 comments on commit b9a17c4

Please sign in to comment.