aboutsummaryrefslogtreecommitdiffstats
path: root/dex/handler.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-11-06 16:02:56 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:52 +0800
commite79feadf101f8cf05ce32ca5be0a9e44a75da1a9 (patch)
tree4ee251e28b28b2827411d9bca718c0e960107241 /dex/handler.go
parent6ed9128259023d440ea3297da85e0a0dba12e941 (diff)
downloadgo-tangerine-e79feadf101f8cf05ce32ca5be0a9e44a75da1a9.tar
go-tangerine-e79feadf101f8cf05ce32ca5be0a9e44a75da1a9.tar.gz
go-tangerine-e79feadf101f8cf05ce32ca5be0a9e44a75da1a9.tar.bz2
go-tangerine-e79feadf101f8cf05ce32ca5be0a9e44a75da1a9.tar.lz
go-tangerine-e79feadf101f8cf05ce32ca5be0a9e44a75da1a9.tar.xz
go-tangerine-e79feadf101f8cf05ce32ca5be0a9e44a75da1a9.tar.zst
go-tangerine-e79feadf101f8cf05ce32ca5be0a9e44a75da1a9.zip
dex: fix conflict caused by rebase
Diffstat (limited to 'dex/handler.go')
-rw-r--r--dex/handler.go17
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())
}
}