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
c0187930
Commit
c0187930
authored
Sep 10, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed some commented code
parent
2f362509
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
92 deletions
+2
-92
vm.go
ethvm/vm.go
+0
-91
messaging.go
ethwire/messaging.go
+1
-0
peer.go
peer.go
+1
-1
No files found.
ethvm/vm.go
View file @
c0187930
...
...
@@ -765,51 +765,7 @@ func (self *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
stack
.
Push
(
ethutil
.
BigD
(
addr
))
}
/*
msg := self.env.State().Manifest().AddMessage(ðstate.Message{
To: addr, From: closure.Address(),
Origin: self.env.Origin(),
Block: self.env.BlockHash(), Timestamp: self.env.Time(), Coinbase: self.env.Coinbase(), Number: self.env.BlockNumber(),
Value: value,
})
// Create a new contract
contract := self.env.State().NewStateObject(addr)
if contract.Balance.Cmp(value) >= 0 {
closure.object.SubAmount(value)
contract.AddAmount(value)
// Set the init script
initCode := mem.Get(offset.Int64(), size.Int64())
msg.Input = initCode
// Transfer all remaining gas to the new
// contract so it may run the init script
gas := new(big.Int).Set(closure.Gas)
closure.UseGas(closure.Gas)
// Create the closure
c := NewClosure(msg, closure, contract, initCode, gas, closure.Price)
// Call the closure and set the return value as
// main script.
contract.Code, _, err = c.Call(self, nil)
} else {
err = fmt.Errorf("Insufficient funds to transfer value. Req %v, has %v", value, closure.object.Balance)
}
if err != nil {
stack.Push(ethutil.BigFalse)
// Revert the state as it was before.
self.env.State().Set(snapshot)
self.Printf("CREATE err %v", err)
} else {
stack.Push(ethutil.BigD(addr))
msg.Output = contract.Code
}
*/
self
.
Endl
()
// Debug hook
...
...
@@ -858,53 +814,6 @@ func (self *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
self
.
Dbg
.
SetCode
(
closure
.
Code
)
}
/*
msg := self.env.State().Manifest().AddMessage(ðstate.Message{
To: addr.Bytes(), From: closure.Address(),
Input: args,
Origin: self.env.Origin(),
Block: self.env.BlockHash(), Timestamp: self.env.Time(), Coinbase: self.env.Coinbase(), Number: self.env.BlockNumber(),
Value: value,
})
if closure.object.Balance.Cmp(value) < 0 {
vmlogger.Debugf("Insufficient funds to transfer value. Req %v, has %v", value, closure.object.Balance)
closure.ReturnGas(gas, nil)
stack.Push(ethutil.BigFalse)
} else {
snapshot := self.env.State().Copy()
stateObject := self.env.State().GetOrNewStateObject(addr.Bytes())
closure.object.SubAmount(value)
stateObject.AddAmount(value)
// Create a new callable closure
c := NewClosure(msg, closure, stateObject, stateObject.Code, gas, closure.Price)
// Executer the closure and get the return value (if any)
ret, _, err := c.Call(self, args)
if err != nil {
stack.Push(ethutil.BigFalse)
vmlogger.Debugf("Closure execution failed. %v\n", err)
self.env.State().Set(snapshot)
} else {
stack.Push(ethutil.BigTrue)
mem.Set(retOffset.Int64(), retSize.Int64(), ret)
}
msg.Output = ret
// Debug hook
if self.Dbg != nil {
self.Dbg.SetCode(closure.Code)
}
}
*/
case
POST
:
require
(
6
)
...
...
ethwire/messaging.go
View file @
c0187930
...
...
@@ -49,6 +49,7 @@ var msgTypeToString = map[MsgType]string{
MsgPingTy
:
"Ping"
,
MsgPongTy
:
"Pong"
,
MsgGetPeersTy
:
"Get peers"
,
MsgStatusTy
:
"Status"
,
MsgPeersTy
:
"Peers"
,
MsgTxTy
:
"Transactions"
,
MsgBlockTy
:
"Blocks"
,
...
...
peer.go
View file @
c0187930
...
...
@@ -694,7 +694,7 @@ func (p *Peer) handleHandshake(msg *ethwire.Msg) {
}
// Handle the pub key (validation, uniqueness)
if
pub
==
nil
||
len
(
pub
)
==
0
{
if
len
(
pub
)
==
0
{
peerlogger
.
Warnln
(
"Pubkey required, not supplied in handshake."
)
p
.
Stop
()
return
...
...
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