Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
8a97d13c
Commit
8a97d13c
authored
Apr 06, 2021
by
袁兴强
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into wasm_contract_update_support
parents
511ab799
c62df166
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
common.go
plugin/p2p/gossip/common.go
+1
-1
netaddress.go
plugin/p2p/gossip/netaddress.go
+1
-1
p2pcli.go
plugin/p2p/gossip/p2pcli.go
+3
-3
No files found.
plugin/p2p/gossip/common.go
View file @
8a97d13c
...
...
@@ -115,7 +115,7 @@ func (c Comm) dialPeer(addr *NetAddress, node *Node) (*Peer, error) {
}
peer
,
err
:=
c
.
dialPeerWithAddress
(
addr
,
persistent
,
node
)
if
err
!=
nil
{
log
.
Error
(
"dialPeer"
,
"
nodeListenAddr"
,
node
.
nodeInfo
.
listenAddr
.
str
,
"
peerAddr"
,
addr
.
str
,
"err"
,
err
)
log
.
Error
(
"dialPeer"
,
"peerAddr"
,
addr
.
str
,
"err"
,
err
)
return
nil
,
err
}
//获取远程节点的信息 peer
...
...
plugin/p2p/gossip/netaddress.go
View file @
8a97d13c
...
...
@@ -191,7 +191,7 @@ func (na *NetAddress) DialTimeout(version int32, creds credentials.TransportCred
}
if
err
!=
nil
{
log
.
Debug
(
"grpc DialCon Uncompressor"
,
"
did not connect
"
,
err
)
log
.
Debug
(
"grpc DialCon Uncompressor"
,
"
connect err
"
,
err
)
if
conn
!=
nil
{
errs
:=
conn
.
Close
()
if
errs
!=
nil
{
...
...
plugin/p2p/gossip/p2pcli.go
View file @
8a97d13c
...
...
@@ -267,7 +267,7 @@ func (m *Cli) SendVersion(peer *Peer, nodeinfo *NodeInfo) (string, error) {
resp
,
err
:=
peer
.
mconn
.
gcli
.
Version2
(
context
.
Background
(),
&
pb
.
P2PVersion
{
Version
:
nodeinfo
.
channelVersion
,
Service
:
int64
(
nodeinfo
.
ServiceTy
()),
Timestamp
:
pb
.
Now
()
.
Unix
(),
AddrRecv
:
peer
.
Addr
(),
AddrFrom
:
addrfrom
,
Nonce
:
int64
(
rand
.
Int31n
(
102040
)),
UserAgent
:
hex
.
EncodeToString
(
in
.
Sign
.
GetPubkey
()),
StartHeight
:
blockheight
},
grpc
.
FailFast
(
true
))
log
.
Debug
(
"SendVersion"
,
"resp"
,
resp
,
"
addrfrom"
,
addrfrom
,
"send
to"
,
peer
.
Addr
())
log
.
Debug
(
"SendVersion"
,
"resp"
,
resp
,
"
from"
,
addrfrom
,
"
to"
,
peer
.
Addr
())
if
err
!=
nil
{
log
.
Error
(
"SendVersion"
,
"Verson"
,
err
.
Error
(),
"peer"
,
peer
.
Addr
())
if
err
==
pb
.
ErrVersion
{
...
...
@@ -278,7 +278,7 @@ func (m *Cli) SendVersion(peer *Peer, nodeinfo *NodeInfo) (string, error) {
}
P2pComm
.
CollectPeerStat
(
err
,
peer
)
log
.
Debug
(
"SHOW VERSION BACK"
,
"VersionBack"
,
resp
,
"peer"
,
peer
.
Addr
())
log
.
Debug
(
"SHOW VERSION BACK"
,
"VersionBack"
,
resp
,
"
remote
peer"
,
peer
.
Addr
())
_
,
ver
:=
utils
.
DecodeChannelVersion
(
resp
.
GetVersion
())
peer
.
version
.
SetVersion
(
ver
)
...
...
@@ -286,7 +286,7 @@ func (m *Cli) SendVersion(peer *Peer, nodeinfo *NodeInfo) (string, error) {
if
err
==
nil
{
if
ip
!=
nodeinfo
.
GetExternalAddr
()
.
IP
.
String
()
{
log
.
Debug
(
"sendVersion"
,
"ex
ternalip"
,
ip
)
log
.
Debug
(
"sendVersion"
,
"ex
pect ip"
,
ip
,
"pre externalip"
,
nodeinfo
.
GetExternalAddr
()
.
IP
.
String
()
)
if
peer
.
IsPersistent
()
{
//永久加入黑名单
nodeinfo
.
blacklist
.
Add
(
ip
,
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment