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
e28632b9
Commit
e28632b9
authored
Jan 30, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mine?
parent
8f16b665
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
21 deletions
+29
-21
dev_console.go
dev_console.go
+2
-2
ethereum.go
ethereum.go
+27
-19
No files found.
dev_console.go
View file @
e28632b9
...
@@ -124,8 +124,8 @@ func (i *Console) ParseInput(input string) bool {
...
@@ -124,8 +124,8 @@ func (i *Console) ParseInput(input string) bool {
ethutil
.
BigPow
(
2
,
36
),
// diff
ethutil
.
BigPow
(
2
,
36
),
// diff
ethutil
.
Big
(
tokens
[
2
])))
// nonce
ethutil
.
Big
(
tokens
[
2
])))
// nonce
case
"decode"
:
case
"decode"
:
d
,
_
:=
ethutil
.
Decode
([]
byte
(
tokens
[
1
]),
0
)
value
:=
ethutil
.
NewRlpDecoder
([]
byte
(
tokens
[
1
])
)
fmt
.
Print
f
(
"%q
\n
"
,
d
)
fmt
.
Print
ln
(
value
)
case
"getaddr"
:
case
"getaddr"
:
encoded
,
_
:=
hex
.
DecodeString
(
tokens
[
1
])
encoded
,
_
:=
hex
.
DecodeString
(
tokens
[
1
])
d
:=
i
.
ethereum
.
BlockManager
.
BlockChain
()
.
CurrentBlock
.
State
()
.
Get
(
string
(
encoded
))
d
:=
i
.
ethereum
.
BlockManager
.
BlockChain
()
.
CurrentBlock
.
State
()
.
Get
(
string
(
encoded
))
...
...
ethereum.go
View file @
e28632b9
...
@@ -8,7 +8,6 @@ import (
...
@@ -8,7 +8,6 @@ import (
"github.com/ethereum/ethutil-go"
"github.com/ethereum/ethutil-go"
_
"github.com/ethereum/ethwire-go"
_
"github.com/ethereum/ethwire-go"
"log"
"log"
"math/big"
"os"
"os"
"os/signal"
"os/signal"
"path"
"path"
...
@@ -89,26 +88,35 @@ func main() {
...
@@ -89,26 +88,35 @@ func main() {
// 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
()
{
for
{
pow
:=
&
ethchain
.
EasyPow
{}
time
.
Sleep
(
blockTime
*
time
.
Second
)
for
{
txs
:=
ethereum
.
TxPool
.
Flush
()
txs
:=
ethereum
.
TxPool
.
Flush
()
block
:=
ethereum
.
BlockManager
.
BlockChain
()
.
NewBlock
(
"82c3b0b72cf62f1a9ce97c64da8072efa28225d8"
,
txs
)
block
:=
ethchain
.
CreateBlock
(
ethereum
.
BlockManager
.
BlockChain
()
.
CurrentBlock
.
State
()
.
Root
,
nonce
:=
pow
.
Search
(
block
)
ethereum
.
BlockManager
.
BlockChain
()
.
LastBlockHash
,
block
.
Nonce
=
nonce
"123"
,
big
.
NewInt
(
1
),
log
.
Println
(
"nonce found:"
,
nonce
)
big
.
NewInt
(
1
),
/*
""
,
time.Sleep(blockTime * time.Second)
txs
)
err
:=
ethereum
.
BlockManager
.
ProcessBlockWithState
(
block
,
block
.
State
())
if
err
!=
nil
{
block := ethchain.CreateBlock(
log
.
Println
(
err
)
ethereum.BlockManager.BlockChain().CurrentBlock.State().Root,
}
else
{
ethereum.BlockManager.BlockChain().LastBlockHash,
//log.Println("\n+++++++ MINED BLK +++++++\n", block.String())
"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