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
ad048e9f
Commit
ad048e9f
authored
Dec 29, 2013
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update test
parent
0edcbc69
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
8 deletions
+19
-8
ethereum.go
ethereum.go
+19
-8
No files found.
ethereum.go
View file @
ad048e9f
...
...
@@ -2,10 +2,27 @@ package main
import
(
"fmt"
"os"
"os/signal"
)
const
Debug
=
false
// Register interrupt handlers so we can stop the server
func
RegisterInterupts
(
s
*
Server
)
{
// Buffered chan of one is enough
c
:=
make
(
chan
os
.
Signal
,
1
)
// Notify about interrupts for now
signal
.
Notify
(
c
,
os
.
Interrupt
)
go
func
()
{
for
sig
:=
range
c
{
fmt
.
Println
(
"Shutting down (%v) ...
\n
"
,
sig
)
s
.
Stop
()
}
}()
}
func
main
()
{
InitFees
()
...
...
@@ -30,17 +47,11 @@ func main() {
copyTx
:=
&
Transaction
{}
copyTx
.
UnmarshalRlp
(
txData
)
tx2
:=
NewTransaction
(
"
\x00
"
,
20
,
[]
string
{
"SET 10 6"
,
"LD 10 10"
})
blck
:=
New
Block
([]
*
Transaction
{
tx2
,
tx
})
blck
:=
Create
Block
([]
*
Transaction
{
tx2
,
tx
})
bm
.
ProcessBlock
(
blck
)
t
:=
blck
.
MarshalRlp
()
copyBlock
:=
&
Block
{}
copyBlock
.
UnmarshalRlp
(
t
)
fmt
.
Println
(
blck
)
fmt
.
Println
(
copyBlock
)
fmt
.
Println
(
"GenesisBlock:"
,
GenisisBlock
,
"hashed"
,
GenisisBlock
.
Hash
())
}
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