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
39047e9b
Commit
39047e9b
authored
Nov 22, 2018
by
harrylee2015
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into game
parents
57b101ee
d6a01768
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
15 deletions
+13
-15
consensus_state.go
plugin/consensus/tendermint/consensus_state.go
+1
-1
node.go
plugin/consensus/tendermint/node.go
+10
-10
state.go
plugin/consensus/tendermint/state.go
+1
-1
block.go
plugin/consensus/tendermint/types/block.go
+0
-1
height_vote_set.go
plugin/consensus/tendermint/types/height_vote_set.go
+0
-1
util.go
plugin/consensus/tendermint/types/util.go
+1
-1
No files found.
plugin/consensus/tendermint/consensus_state.go
View file @
39047e9b
...
...
@@ -862,7 +862,7 @@ func (cs *ConsensusState) enterPrecommit(height int64, round int) {
// the latest POLRound should be this round
polRound
,
_
:=
cs
.
Votes
.
POLInfo
()
if
polRound
<
round
{
panic
(
fmt
.
Sprintf
(
"Panicked on a Sanity Check: %v"
,
fmt
.
Sprintf
(
"This POLRound should be %v but got %"
,
round
,
polRound
)))
panic
(
fmt
.
Sprintf
(
"Panicked on a Sanity Check: %v"
,
fmt
.
Sprintf
(
"This POLRound should be %v but got %
v
"
,
round
,
polRound
)))
}
// +2/3 prevoted nil. Unlock and precommit nil.
...
...
plugin/consensus/tendermint/node.go
View file @
39047e9b
...
...
@@ -408,7 +408,7 @@ func (node *Node) addInboundPeer(conn net.Conn) error {
// peer to the switch and to all registered reactors.
// NOTE: This performs a blocking handshake before the peer is added.
// NOTE: If error is returned, caller is responsible for calling peer.CloseConn()
func
(
node
*
Node
)
addPeer
(
pc
peerConn
)
error
{
func
(
node
*
Node
)
addPeer
(
pc
*
peerConn
)
error
{
addr
:=
pc
.
conn
.
RemoteAddr
()
if
err
:=
node
.
FilterConnByAddr
(
addr
);
err
!=
nil
{
return
err
...
...
@@ -472,7 +472,7 @@ func (node *Node) addPeer(pc peerConn) error {
// All good. Start peer
if
node
.
IsRunning
()
{
pc
.
SetTransferChannel
(
node
.
state
.
peerMsgQueue
)
if
err
=
node
.
startInitPeer
(
&
pc
);
err
!=
nil
{
if
err
=
node
.
startInitPeer
(
pc
);
err
!=
nil
{
return
err
}
}
...
...
@@ -480,7 +480,7 @@ func (node *Node) addPeer(pc peerConn) error {
// Add the peer to .peers.
// We start it first so that a peer in the list is safe to Stop.
// It should not err since we already checked peers.Has().
if
err
:=
node
.
peerSet
.
Add
(
&
pc
);
err
!=
nil
{
if
err
:=
node
.
peerSet
.
Add
(
pc
);
err
!=
nil
{
return
err
}
//node.metrics.Peers.Add(float64(1))
...
...
@@ -686,18 +686,18 @@ func dial(addr string) (net.Conn, error) {
return
conn
,
nil
}
func
newOutboundPeerConn
(
addr
string
,
ourNodePrivKey
crypto
.
PrivKey
,
onPeerError
func
(
Peer
,
interface
{}),
state
*
ConsensusState
,
evpool
*
EvidencePool
)
(
peerConn
,
error
)
{
func
newOutboundPeerConn
(
addr
string
,
ourNodePrivKey
crypto
.
PrivKey
,
onPeerError
func
(
Peer
,
interface
{}),
state
*
ConsensusState
,
evpool
*
EvidencePool
)
(
*
peerConn
,
error
)
{
conn
,
err
:=
dial
(
addr
)
if
err
!=
nil
{
return
peerConn
{},
fmt
.
Errorf
(
"Error creating peer:%v"
,
err
)
return
&
peerConn
{},
fmt
.
Errorf
(
"Error creating peer:%v"
,
err
)
}
pc
,
err
:=
newPeerConn
(
conn
,
true
,
true
,
ourNodePrivKey
,
onPeerError
,
state
,
evpool
)
if
err
!=
nil
{
if
cerr
:=
conn
.
Close
();
cerr
!=
nil
{
return
peerConn
{},
fmt
.
Errorf
(
"newPeerConn failed:%v, connection close failed:%v"
,
err
,
cerr
)
return
&
peerConn
{},
fmt
.
Errorf
(
"newPeerConn failed:%v, connection close failed:%v"
,
err
,
cerr
)
}
return
peerConn
{},
err
return
&
peerConn
{},
err
}
return
pc
,
nil
...
...
@@ -709,7 +709,7 @@ func newInboundPeerConn(
onPeerError
func
(
Peer
,
interface
{}),
state
*
ConsensusState
,
evpool
*
EvidencePool
,
)
(
peerConn
,
error
)
{
)
(
*
peerConn
,
error
)
{
// TODO: issue PoW challenge
...
...
@@ -723,7 +723,7 @@ func newPeerConn(
onPeerError
func
(
Peer
,
interface
{}),
state
*
ConsensusState
,
evpool
*
EvidencePool
,
)
(
pc
peerConn
,
err
error
)
{
)
(
pc
*
peerConn
,
err
error
)
{
conn
:=
rawConn
// Set deadline for secret handshake
...
...
@@ -739,7 +739,7 @@ func newPeerConn(
}
// Only the information we already have
return
peerConn
{
return
&
peerConn
{
outbound
:
outbound
,
persistent
:
persistent
,
conn
:
conn
,
...
...
plugin/consensus/tendermint/state.go
View file @
39047e9b
...
...
@@ -174,7 +174,7 @@ func MakeGenesisState(genDoc *ttypes.GenesisDoc) (State, error) {
for
i
,
val
:=
range
genDoc
.
Validators
{
pubKey
,
err
:=
ttypes
.
PubKeyFromString
(
val
.
PubKey
.
Data
)
if
err
!=
nil
{
return
State
{},
fmt
.
Errorf
(
"Error validate[
i
] in genesis file: %v"
,
i
,
err
)
return
State
{},
fmt
.
Errorf
(
"Error validate[
%v
] in genesis file: %v"
,
i
,
err
)
}
// Make validator
...
...
plugin/consensus/tendermint/types/block.go
View file @
39047e9b
...
...
@@ -505,5 +505,4 @@ func (data *EvidenceData) StringIndented(indent string) string {
%s}#%v`
,
indent
,
strings
.
Join
(
evStrings
,
"
\n
"
+
indent
+
" "
),
indent
,
data
.
hash
)
return
""
}
plugin/consensus/tendermint/types/height_vote_set.go
View file @
39047e9b
...
...
@@ -171,7 +171,6 @@ func (hvs *HeightVoteSet) getVoteSet(round int, type_ byte) *VoteSet {
return
rvs
.
Precommits
default
:
panic
(
Fmt
(
"Panicked on a Sanity Check: %v"
,
Fmt
(
"Unexpected vote type %X"
,
type_
)))
return
nil
}
}
...
...
plugin/consensus/tendermint/types/util.go
View file @
39047e9b
...
...
@@ -189,7 +189,7 @@ func PanicQ(v interface{}) {
//--------------------BitArray------------------------
type
BitArray
struct
{
*
tmtypes
.
TendermintBitArray
mtx
sync
.
Mutex
`json:"-"`
mtx
sync
.
Mutex
}
// There is no BitArray whose Size is 0. Use nil instead.
...
...
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