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
035f0ffb
Commit
035f0ffb
authored
Apr 09, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reverted changes
parent
527a3bbc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
state_manager.go
ethchain/state_manager.go
+2
-2
transaction_pool.go
ethchain/transaction_pool.go
+5
-5
No files found.
ethchain/state_manager.go
View file @
035f0ffb
...
@@ -114,12 +114,12 @@ func (sm *StateManager) ApplyTransactions(block *Block, txs []*Transaction) {
...
@@ -114,12 +114,12 @@ func (sm *StateManager) ApplyTransactions(block *Block, txs []*Transaction) {
// contract instead of moving funds between accounts.
// contract instead of moving funds between accounts.
var
err
error
var
err
error
if
contract
:=
sm
.
procState
.
GetContract
(
tx
.
Recipient
);
contract
!=
nil
{
if
contract
:=
sm
.
procState
.
GetContract
(
tx
.
Recipient
);
contract
!=
nil
{
err
=
sm
.
Ethereum
.
TxPool
()
.
ProcessTransaction
(
tx
,
sm
.
procState
,
true
)
err
=
sm
.
Ethereum
.
TxPool
()
.
ProcessTransaction
(
tx
,
block
,
true
)
if
err
==
nil
{
if
err
==
nil
{
sm
.
ProcessContract
(
contract
,
tx
,
block
)
sm
.
ProcessContract
(
contract
,
tx
,
block
)
}
}
}
else
{
}
else
{
err
=
sm
.
Ethereum
.
TxPool
()
.
ProcessTransaction
(
tx
,
sm
.
procState
,
false
)
err
=
sm
.
Ethereum
.
TxPool
()
.
ProcessTransaction
(
tx
,
block
,
false
)
}
}
if
err
!=
nil
{
if
err
!=
nil
{
...
...
ethchain/transaction_pool.go
View file @
035f0ffb
...
@@ -90,7 +90,7 @@ func (pool *TxPool) addTransaction(tx *Transaction) {
...
@@ -90,7 +90,7 @@ func (pool *TxPool) addTransaction(tx *Transaction) {
// Process transaction validates the Tx and processes funds from the
// Process transaction validates the Tx and processes funds from the
// sender to the recipient.
// sender to the recipient.
func
(
pool
*
TxPool
)
ProcessTransaction
(
tx
*
Transaction
,
state
*
State
,
toContract
bool
)
(
err
error
)
{
func
(
pool
*
TxPool
)
ProcessTransaction
(
tx
*
Transaction
,
block
*
Block
,
toContract
bool
)
(
err
error
)
{
defer
func
()
{
defer
func
()
{
if
r
:=
recover
();
r
!=
nil
{
if
r
:=
recover
();
r
!=
nil
{
log
.
Println
(
r
)
log
.
Println
(
r
)
...
@@ -98,7 +98,7 @@ func (pool *TxPool) ProcessTransaction(tx *Transaction, state *State, toContract
...
@@ -98,7 +98,7 @@ func (pool *TxPool) ProcessTransaction(tx *Transaction, state *State, toContract
}
}
}()
}()
// Get the sender
// Get the sender
sender
:=
state
.
GetAccount
(
tx
.
Sender
())
sender
:=
block
.
state
.
GetAccount
(
tx
.
Sender
())
// Make sure there's enough in the sender's account. Having insufficient
// Make sure there's enough in the sender's account. Having insufficient
// funds won't invalidate this transaction but simple ignores it.
// funds won't invalidate this transaction but simple ignores it.
...
@@ -112,7 +112,7 @@ func (pool *TxPool) ProcessTransaction(tx *Transaction, state *State, toContract
...
@@ -112,7 +112,7 @@ func (pool *TxPool) ProcessTransaction(tx *Transaction, state *State, toContract
}
}
// Get the receiver
// Get the receiver
receiver
:=
state
.
GetAccount
(
tx
.
Recipient
)
receiver
:=
block
.
state
.
GetAccount
(
tx
.
Recipient
)
sender
.
Nonce
+=
1
sender
.
Nonce
+=
1
// Send Tx to self
// Send Tx to self
...
@@ -128,10 +128,10 @@ func (pool *TxPool) ProcessTransaction(tx *Transaction, state *State, toContract
...
@@ -128,10 +128,10 @@ func (pool *TxPool) ProcessTransaction(tx *Transaction, state *State, toContract
// Add the amount to receivers account which should conclude this transaction
// Add the amount to receivers account which should conclude this transaction
receiver
.
Amount
.
Add
(
receiver
.
Amount
,
tx
.
Value
)
receiver
.
Amount
.
Add
(
receiver
.
Amount
,
tx
.
Value
)
state
.
UpdateAccount
(
tx
.
Recipient
,
receiver
)
block
.
state
.
UpdateAccount
(
tx
.
Recipient
,
receiver
)
}
}
state
.
UpdateAccount
(
tx
.
Sender
(),
sender
)
block
.
state
.
UpdateAccount
(
tx
.
Sender
(),
sender
)
log
.
Printf
(
"[TXPL] Processed Tx %x
\n
"
,
tx
.
Hash
())
log
.
Printf
(
"[TXPL] Processed Tx %x
\n
"
,
tx
.
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