diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-11-06 16:02:56 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:18 +0800 |
commit | c1548136288e12b83a993821b5668899aca53804 (patch) | |
tree | a4685f67f60379420ef1f94caeb7ec792f3b869d /dex/handler.go | |
parent | 5db9884093fe8187fbf52bbdd96d4e166ab24a85 (diff) | |
download | go-tangerine-c1548136288e12b83a993821b5668899aca53804.tar.gz go-tangerine-c1548136288e12b83a993821b5668899aca53804.tar.zst go-tangerine-c1548136288e12b83a993821b5668899aca53804.zip |
dex: fix conflict caused by rebase
Diffstat (limited to 'dex/handler.go')
-rw-r--r-- | dex/handler.go | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/dex/handler.go b/dex/handler.go index 68c682eda..2f8ed13fa 100644 --- a/dex/handler.go +++ b/dex/handler.go @@ -39,6 +39,7 @@ import ( "fmt" "math" "math/big" + "net" "sync" "sync/atomic" "time" @@ -282,8 +283,8 @@ func (pm *ProtocolManager) makeSelfNodeMeta() *NodeMeta { meta := &NodeMeta{ ID: self.ID(), IP: self.IP(), - UDP: self.UDP(), - TCP: self.TCP(), + UDP: uint(self.UDP()), + TCP: uint(self.TCP()), Timestamp: uint64(time.Now().Unix()), } @@ -942,11 +943,17 @@ func (pm *ProtocolManager) BroadcastRandomnessResult( func (pm *ProtocolManager) SendDKGPrivateShare( pub coreCrypto.PublicKey, privateShare *dkgTypes.PrivateShare) { - id := string(pub.Bytes()[1:]) - if p := pm.peers.Peer(id); p != nil { + + pk, err := crypto.UnmarshalPubkey(pub.Bytes()) + if err != nil { + panic(err) + } + n := enode.NewV4(pk, net.IP{}, 0, 0) + + if p := pm.peers.Peer(n.ID().String()); p != nil { p.AsyncSendDKGPrivateShare(privateShare) } else { - log.Error("Failed to send DKG private share", "publicKey", id) + log.Error("Failed to send DKG private share", "publicKey", n.ID().String()) } } |