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
0afdedb0
Commit
0afdedb0
authored
Feb 24, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some log statements changed to the default logger
parent
6c7255cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
26 deletions
+9
-26
block_manager.go
ethchain/block_manager.go
+4
-21
vm.go
ethchain/vm.go
+5
-5
No files found.
ethchain/block_manager.go
View file @
0afdedb0
...
...
@@ -165,37 +165,20 @@ func (bm *BlockManager) ProcessBlock(block *Block) error {
if
bm
.
CalculateTD
(
block
)
{
// Sync the current block's state to the database and cancelling out the deferred Undo
bm
.
bc
.
CurrentBlock
.
Sync
()
// Add the block to the chain
bm
.
bc
.
Add
(
block
)
/*
ethutil.Config.Db.Put(block.Hash(), block.RlpEncode())
bm.bc.CurrentBlock = block
bm.LastBlockHash = block.Hash()
bm.writeBlockInfo(block)
*/
/*
txs := bm.TransactionPool.Flush()
var coded = []interface{}{}
for _, tx := range txs {
err := bm.TransactionPool.ValidateTransaction(tx)
if err == nil {
coded = append(coded, tx.RlpEncode())
}
}
*/
// Broadcast the valid block back to the wire
//bm.Speaker.Broadcast(ethwire.MsgBlockTy, []interface{}{block.Value().Val})
// Add the block to the chain
bm
.
bc
.
Add
(
block
)
// If there's a block processor present, pass in the block for further
// processing
if
bm
.
SecondaryBlockProcessor
!=
nil
{
bm
.
SecondaryBlockProcessor
.
ProcessBlock
(
block
)
}
log
.
Print
f
(
"[BMGR] Added block #%d (%x)
\n
"
,
block
.
BlockInfo
()
.
Number
,
block
.
Hash
())
ethutil
.
Config
.
Log
.
Info
f
(
"[BMGR] Added block #%d (%x)
\n
"
,
block
.
BlockInfo
()
.
Number
,
block
.
Hash
())
}
else
{
fmt
.
Println
(
"total diff failed"
)
}
...
...
ethchain/vm.go
View file @
0afdedb0
...
...
@@ -48,7 +48,7 @@ func (vm *Vm) Process(contract *Contract, state *State, vars RuntimeVars) {
Pow256
:=
ethutil
.
BigPow
(
2
,
256
)
if
ethutil
.
Config
.
Debug
{
fmt
.
Print
f
(
"# op
\n
"
)
ethutil
.
Config
.
Log
.
Debug
f
(
"# op
\n
"
)
}
stepcount
:=
0
...
...
@@ -98,7 +98,7 @@ out:
totalFee
.
Add
(
totalFee
,
tf
)
if
ethutil
.
Config
.
Debug
{
fmt
.
Print
f
(
"%-3d %-4s"
,
pc
,
op
.
String
())
ethutil
.
Config
.
Log
.
Debug
f
(
"%-3d %-4s"
,
pc
,
op
.
String
())
}
switch
op
{
...
...
@@ -385,12 +385,12 @@ out:
// Delete the contract
state
.
trie
.
Update
(
string
(
addr
),
""
)
fmt
.
Print
f
(
"(%d) => %x
\n
"
,
deletedMemory
,
recAddr
)
ethutil
.
Config
.
Log
.
Debug
f
(
"(%d) => %x
\n
"
,
deletedMemory
,
recAddr
)
break
out
default
:
fmt
.
Printf
(
"Invalid OPCODE: %x
\n
"
,
op
)
}
fmt
.
Print
ln
(
""
)
ethutil
.
Config
.
Log
.
Debug
ln
(
""
)
//vm.stack.Print()
pc
++
}
...
...
@@ -399,7 +399,7 @@ out:
}
func
makeInlineTx
(
addr
[]
byte
,
value
,
from
,
length
*
big
.
Int
,
contract
*
Contract
,
state
*
State
)
{
fmt
.
Print
f
(
" => creating inline tx %x %v %v %v"
,
addr
,
value
,
from
,
length
)
ethutil
.
Config
.
Log
.
Debug
f
(
" => creating inline tx %x %v %v %v"
,
addr
,
value
,
from
,
length
)
j
:=
0
dataItems
:=
make
([]
string
,
int
(
length
.
Uint64
()))
for
i
:=
from
.
Uint64
();
i
<
length
.
Uint64
();
i
++
{
...
...
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