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
8703305a
Commit
8703305a
authored
Apr 26, 2020
by
jiangpeng
Committed by
vipwzw
Apr 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
p2p/gossip:udpate test
parent
ad322388
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
p2p_test.go
plugin/p2p/gossip/p2p_test.go
+3
-0
process.go
plugin/p2p/gossip/process.go
+3
-3
No files found.
plugin/p2p/gossip/p2p_test.go
View file @
8703305a
...
...
@@ -44,6 +44,9 @@ func processMsg(q queue.Queue) {
wcli
:=
wallet
.
New
(
cfg
)
client
:=
q
.
Client
()
wcli
.
SetQueueClient
(
client
)
defer
func
(
path
string
)
{
_
=
os
.
RemoveAll
(
path
)
}(
cfg
.
GetModuleConfig
()
.
Wallet
.
DbPath
)
//导入种子,解锁钱包
password
:=
"a12345678"
seed
:=
"cushion canal bitter result harvest sentence ability time steel basket useful ask depth sorry area course purpose search exile chapter mountain project ranch buffalo"
...
...
plugin/p2p/gossip/process.go
View file @
8703305a
...
...
@@ -127,7 +127,7 @@ func (n *Node) sendBlock(block *types.P2PBlock, p2pData *types.BroadCastData, pe
// cache block
if
!
totalBlockCache
.
Contains
(
blockHash
)
{
totalBlockCache
.
Add
(
blockHash
,
block
.
Block
,
ltBlock
.
Size
)
totalBlockCache
.
Add
(
blockHash
,
block
.
Block
,
int
(
ltBlock
.
Size
)
)
}
p2pData
.
Value
=
&
types
.
BroadCastData_LtBlock
{
LtBlock
:
ltBlock
}
...
...
@@ -355,7 +355,7 @@ func (n *Node) recvLtBlock(ltBlock *types.LightBlock, pid, peerAddr string, pubP
//pub to specified peer
pubPeerFunc
(
query
,
pid
)
//需要将不完整的block预存
ltBlockCache
.
Add
(
blockHash
,
block
,
int64
(
block
.
Size
()
))
ltBlockCache
.
Add
(
blockHash
,
block
,
block
.
Size
(
))
}
func
(
n
*
Node
)
recvQueryData
(
query
*
types
.
P2PQueryData
,
pid
,
peerAddr
string
,
pubPeerFunc
pubFuncType
)
{
...
...
@@ -443,7 +443,7 @@ func (n *Node) recvQueryReply(rep *types.P2PBlockTxReply, pid, peerAddr string,
//pub to specified peer
pubPeerFunc
(
query
,
pid
)
block
.
Txs
=
nil
ltBlockCache
.
Add
(
rep
.
BlockHash
,
block
,
int64
(
block
.
Size
()
))
ltBlockCache
.
Add
(
rep
.
BlockHash
,
block
,
block
.
Size
(
))
}
}
...
...
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