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
753d62a4
Commit
753d62a4
authored
Jun 17, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: TMP testing code
parent
bdd63837
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
21 deletions
+23
-21
block_processor.go
core/block_processor.go
+8
-15
context.go
core/vm/context.go
+15
-6
No files found.
core/block_processor.go
View file @
753d62a4
...
@@ -246,25 +246,18 @@ func (sm *BlockProcessor) processWithParent(block, parent *types.Block) (logs st
...
@@ -246,25 +246,18 @@ func (sm *BlockProcessor) processWithParent(block, parent *types.Block) (logs st
return
return
}
}
// store the receipts
err
=
putReceipts
(
sm
.
extraDb
,
block
.
Hash
(),
receipts
)
if
err
!=
nil
{
return
nil
,
err
}
// Sync the current block's state to the database
// Sync the current block's state to the database
state
.
Sync
()
state
.
Sync
()
go
func
()
{
// This puts transactions in a extra db for rpc
// This puts transactions in a extra db for rpc
for
i
,
tx
:=
range
block
.
Transactions
()
{
for
i
,
tx
:=
range
block
.
Transactions
()
{
putTx
(
sm
.
extraDb
,
tx
,
block
,
uint64
(
i
))
putTx
(
sm
.
extraDb
,
tx
,
block
,
uint64
(
i
))
}
}
receiptsRlp
:=
receipts
.
RlpEncode
()
// store the receipts
/*if len(receipts) > 0 {
putReceipts
(
sm
.
extraDb
,
block
.
Hash
(),
receipts
)
glog.V(logger.Info).Infof("Saving %v receipts, rlp len is %v\n", len(receipts), len(receiptsRlp))
}()
}*/
sm
.
extraDb
.
Put
(
append
(
receiptsPre
,
block
.
Hash
()
.
Bytes
()
...
),
receiptsRlp
)
return
state
.
Logs
(),
nil
return
state
.
Logs
(),
nil
}
}
...
...
core/vm/context.go
View file @
753d62a4
...
@@ -26,16 +26,25 @@ type Context struct {
...
@@ -26,16 +26,25 @@ type Context struct {
Args
[]
byte
Args
[]
byte
}
}
var
dests
destinations
func
init
()
{
dests
=
make
(
destinations
)
}
// Create a new context for the given data items.
// Create a new context for the given data items.
func
NewContext
(
caller
ContextRef
,
object
ContextRef
,
value
,
gas
,
price
*
big
.
Int
)
*
Context
{
func
NewContext
(
caller
ContextRef
,
object
ContextRef
,
value
,
gas
,
price
*
big
.
Int
)
*
Context
{
c
:=
&
Context
{
caller
:
caller
,
self
:
object
,
Args
:
nil
}
c
:=
&
Context
{
caller
:
caller
,
self
:
object
,
Args
:
nil
}
/*
if parent, ok := caller.(*Context); ok {
if parent, ok := caller.(*Context); ok {
// Reuse JUMPDEST analysis from parent context if available.
// Reuse JUMPDEST analysis from parent context if available.
c.jumpdests = parent.jumpdests
c.jumpdests = parent.jumpdests
} else {
} else {
c.jumpdests = make(destinations)
c.jumpdests = make(destinations)
}
}
*/
c
.
jumpdests
=
dests
// Gas should be a pointer so it can safely be reduced through the run
// Gas should be a pointer so it can safely be reduced through the run
// This pointer will be off the state transition
// This pointer will be off the state transition
...
...
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