Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
张蕾
Geth-Modification
Commits
4a82230d
Commit
4a82230d
authored
Jan 27, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switched port and removed logging
parent
884f7928
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
15 deletions
+3
-15
ethereum.go
ethereum.go
+3
-15
No files found.
ethereum.go
View file @
4a82230d
...
...
@@ -133,8 +133,6 @@ func (s *Ethereum) ReapDeadPeers() {
for
{
eachPeer
(
s
.
peers
,
func
(
p
*
Peer
,
e
*
list
.
Element
)
{
if
atomic
.
LoadInt32
(
&
p
.
disconnect
)
==
1
||
(
p
.
inbound
&&
(
time
.
Now
()
.
Unix
()
-
p
.
lastPong
)
>
int64
(
5
*
time
.
Minute
))
{
log
.
Println
(
"Dead peer found .. reaping"
)
s
.
peers
.
Remove
(
e
)
}
})
...
...
@@ -145,8 +143,8 @@ func (s *Ethereum) ReapDeadPeers() {
// Start the ethereum
func
(
s
*
Ethereum
)
Start
()
{
//
For now this function just blocks the main thread
ln
,
err
:=
net
.
Listen
(
"tcp"
,
":
12345
"
)
//
Bind to addr and port
ln
,
err
:=
net
.
Listen
(
"tcp"
,
":
30303
"
)
if
err
!=
nil
{
// This is mainly for testing to create a "network"
if
ethutil
.
Config
.
Debug
{
...
...
@@ -167,6 +165,7 @@ func (s *Ethereum) Start() {
// Starting accepting connections
go
func
()
{
for
{
log
.
Println
(
"Ready and accepting connections"
)
conn
,
err
:=
ln
.
Accept
()
if
err
!=
nil
{
log
.
Println
(
err
)
...
...
@@ -184,17 +183,6 @@ func (s *Ethereum) Start() {
// Start the tx pool
s
.
TxPool
.
Start
()
// TMP
/*
go func() {
for {
s.Broadcast("block", s.blockManager.bc.GenesisBlock().RlpEncode())
time.Sleep(1000 * time.Millisecond)
}
}()
*/
}
func
(
s
*
Ethereum
)
Stop
()
{
...
...
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