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
5e36e3cc
Commit
5e36e3cc
authored
Feb 03, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Process transactions
parent
ec883db3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
dev_console.go
dev_console.go
+8
-4
ethereum.go
ethereum.go
+4
-8
No files found.
dev_console.go
View file @
5e36e3cc
...
...
@@ -144,11 +144,15 @@ func (i *Console) ParseInput(input string) bool {
case
"encode"
:
fmt
.
Printf
(
"%q
\n
"
,
ethutil
.
Encode
(
tokens
[
1
]))
case
"tx"
:
recipient
,
_
:=
hex
.
DecodeString
(
tokens
[
1
])
tx
:=
ethchain
.
NewTransaction
(
recipient
,
ethutil
.
Big
(
tokens
[
2
]),
[]
string
{
""
})
fmt
.
Printf
(
"%x
\n
"
,
tx
.
Hash
())
recipient
,
err
:=
hex
.
DecodeString
(
tokens
[
1
])
if
err
!=
nil
{
fmt
.
Println
(
"recipient err:"
,
err
)
}
else
{
tx
:=
ethchain
.
NewTransaction
(
recipient
,
ethutil
.
Big
(
tokens
[
2
]),
[]
string
{
""
})
fmt
.
Printf
(
"%x
\n
"
,
tx
.
Hash
())
i
.
ethereum
.
TxPool
.
QueueTransaction
(
tx
)
}
i
.
ethereum
.
TxPool
.
QueueTransaction
(
tx
)
case
"gettx"
:
addr
,
_
:=
hex
.
DecodeString
(
tokens
[
1
])
data
,
_
:=
ethutil
.
Config
.
Db
.
Get
(
addr
)
...
...
ethereum.go
View file @
5e36e3cc
...
...
@@ -7,6 +7,7 @@ import (
"github.com/ethereum/eth-go"
"github.com/ethereum/ethchain-go"
"github.com/ethereum/ethutil-go"
"github.com/ethereum/ethwire-go"
"log"
"os"
"os/signal"
...
...
@@ -88,16 +89,11 @@ func main() {
// Create a new block which we're going to mine
block
:=
ethereum
.
BlockManager
.
BlockChain
()
.
NewBlock
(
addr
,
txs
)
// Apply all transactions to the block
ethereum
.
BlockManager
.
ApplyTransactions
(
block
)
ethereum
.
BlockManager
.
ApplyTransactions
(
block
,
block
.
Transactions
()
)
// Search the nonce
block
.
Nonce
=
pow
.
Search
(
block
)
// Process the block and verify
err
:=
ethereum
.
BlockManager
.
ProcessBlock
(
block
)
if
err
!=
nil
{
log
.
Println
(
err
)
}
else
{
log
.
Println
(
"
\n
+++++++ MINED BLK +++++++
\n
"
,
block
.
String
())
}
ethereum
.
Broadcast
(
ethwire
.
MsgBlockTy
,
[]
interface
{}{
block
.
RlpValue
()
.
Value
})
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