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
ec883db3
Commit
ec883db3
authored
Feb 03, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TApply transactions
parent
00ec15c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
25 deletions
+5
-25
ethereum.go
ethereum.go
+5
-25
No files found.
ethereum.go
View file @
ec883db3
...
@@ -84,40 +84,20 @@ func main() {
...
@@ -84,40 +84,20 @@ func main() {
addr
,
_
:=
hex
.
DecodeString
(
"82c3b0b72cf62f1a9ce97c64da8072efa28225d8"
)
addr
,
_
:=
hex
.
DecodeString
(
"82c3b0b72cf62f1a9ce97c64da8072efa28225d8"
)
for
{
for
{
//time.Sleep(blockTime * time.Second)
txs
:=
ethereum
.
TxPool
.
Flush
()
txs
:=
ethereum
.
TxPool
.
Flush
()
// Create a new block which we're going to mine
block
:=
ethereum
.
BlockManager
.
BlockChain
()
.
NewBlock
(
addr
,
txs
)
block
:=
ethereum
.
BlockManager
.
BlockChain
()
.
NewBlock
(
addr
,
txs
)
// Apply all transactions to the block
ethereum
.
BlockManager
.
ApplyTransactions
(
block
)
// Search the nonce
block
.
Nonce
=
pow
.
Search
(
block
)
block
.
Nonce
=
pow
.
Search
(
block
)
// Process the block and verify
err
:=
ethereum
.
BlockManager
.
ProcessBlock
(
block
)
err
:=
ethereum
.
BlockManager
.
ProcessBlock
(
block
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Println
(
err
)
log
.
Println
(
err
)
}
else
{
}
else
{
//log.Println("nonce found:", nonce)
log
.
Println
(
"
\n
+++++++ MINED BLK +++++++
\n
"
,
block
.
String
())
log
.
Println
(
"
\n
+++++++ MINED BLK +++++++
\n
"
,
block
.
String
())
}
}
//os.Exit(1)
/*
block := ethchain.CreateBlock(
ethereum.BlockManager.BlockChain().CurrentBlock.State().Root,
ethereum.BlockManager.BlockChain().LastBlockHash,
"123",
big.NewInt(1),
big.NewInt(1),
"",
txs)
err := ethereum.BlockManager.ProcessBlockWithState(block, block.State())
if err != nil {
log.Println(err)
} else {
//log.Println("\n+++++++ MINED BLK +++++++\n", block.String())
}
*/
}
}
}()
}()
}
}
...
...
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