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
7f8f0082
Commit
7f8f0082
authored
Feb 02, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed mining
parent
c3ee0e92
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
ethereum.go
ethereum.go
+3
-7
No files found.
ethereum.go
View file @
7f8f0082
...
@@ -7,12 +7,10 @@ import (
...
@@ -7,12 +7,10 @@ import (
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go"
"github.com/ethereum/ethchain-go"
"github.com/ethereum/ethchain-go"
"github.com/ethereum/ethutil-go"
"github.com/ethereum/ethutil-go"
_
"github.com/ethereum/ethwire-go"
"log"
"log"
"os"
"os"
"os/signal"
"os/signal"
"runtime"
"runtime"
"time"
)
)
const
Debug
=
true
const
Debug
=
true
...
@@ -78,8 +76,7 @@ func main() {
...
@@ -78,8 +76,7 @@ func main() {
ethereum
.
Start
()
ethereum
.
Start
()
if
StartMining
{
if
StartMining
{
blockTime
:=
time
.
Duration
(
10
)
log
.
Printf
(
"Dev Test Mining started...
\n
"
)
log
.
Printf
(
"Dev Test Mining started. Blocks found each %d seconds
\n
"
,
blockTime
)
// Fake block mining. It broadcasts a new block every 5 seconds
// Fake block mining. It broadcasts a new block every 5 seconds
go
func
()
{
go
func
()
{
...
@@ -87,13 +84,12 @@ func main() {
...
@@ -87,13 +84,12 @@ func main() {
addr
,
_
:=
hex
.
DecodeString
(
"82c3b0b72cf62f1a9ce97c64da8072efa28225d8"
)
addr
,
_
:=
hex
.
DecodeString
(
"82c3b0b72cf62f1a9ce97c64da8072efa28225d8"
)
for
{
for
{
time
.
Sleep
(
blockTime
*
time
.
Second
)
//
time.Sleep(blockTime * time.Second)
txs
:=
ethereum
.
TxPool
.
Flush
()
txs
:=
ethereum
.
TxPool
.
Flush
()
block
:=
ethereum
.
BlockManager
.
BlockChain
()
.
NewBlock
(
addr
,
txs
)
block
:=
ethereum
.
BlockManager
.
BlockChain
()
.
NewBlock
(
addr
,
txs
)
nonce
:=
pow
.
Search
(
block
)
block
.
Nonce
=
pow
.
Search
(
block
)
block
.
Nonce
=
nonce
err
:=
ethereum
.
BlockManager
.
ProcessBlockWithState
(
block
,
block
.
State
())
err
:=
ethereum
.
BlockManager
.
ProcessBlockWithState
(
block
,
block
.
State
())
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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