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
b4cf57a5
Commit
b4cf57a5
authored
Dec 20, 2017
by
Kurkó Mihály
Committed by
Péter Szilágyi
Dec 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fix typos (#15720)
parent
da58afce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
tx_pool.go
core/tx_pool.go
+3
-3
transaction.go
core/types/transaction.go
+11
-11
No files found.
core/tx_pool.go
View file @
b4cf57a5
...
...
@@ -103,7 +103,7 @@ var (
underpricedTxCounter
=
metrics
.
NewCounter
(
"txpool/underpriced"
)
)
// TxStatus is the current status of a transaction as seen
p
y the pool.
// TxStatus is the current status of a transaction as seen
b
y the pool.
type
TxStatus
uint
const
(
...
...
@@ -199,7 +199,7 @@ type TxPool struct {
pendingState
*
state
.
ManagedState
// Pending state tracking virtual nonces
currentMaxGas
*
big
.
Int
// Current gas limit for transaction caps
locals
*
accountSet
// Set of local transaction to exe
pmt from evic
ion rules
locals
*
accountSet
// Set of local transaction to exe
mpt from evict
ion rules
journal
*
txJournal
// Journal of local transaction to back up to disk
pending
map
[
common
.
Address
]
*
txList
// All currently processable transactions
...
...
@@ -214,7 +214,7 @@ type TxPool struct {
}
// NewTxPool creates a new transaction pool to gather, sort and filter inbound
// trnsactions from the network.
// tr
a
nsactions from the network.
func
NewTxPool
(
config
TxPoolConfig
,
chainconfig
*
params
.
ChainConfig
,
chain
blockChain
)
*
TxPool
{
// Sanitize the input to ensure no vulnerable gas prices are set
config
=
(
&
config
)
.
sanitize
()
...
...
core/types/transaction.go
View file @
b4cf57a5
...
...
@@ -153,6 +153,7 @@ func (tx *Transaction) DecodeRLP(s *rlp.Stream) error {
return
err
}
// MarshalJSON encodes the web3 RPC transaction format.
func
(
tx
*
Transaction
)
MarshalJSON
()
([]
byte
,
error
)
{
hash
:=
tx
.
Hash
()
data
:=
tx
.
data
...
...
@@ -168,8 +169,8 @@ func (tx *Transaction) UnmarshalJSON(input []byte) error {
}
var
V
byte
if
isProtectedV
(
dec
.
V
)
{
chainI
d
:=
deriveChainId
(
dec
.
V
)
.
Uint64
()
V
=
byte
(
dec
.
V
.
Uint64
()
-
35
-
2
*
chainI
d
)
chainI
D
:=
deriveChainId
(
dec
.
V
)
.
Uint64
()
V
=
byte
(
dec
.
V
.
Uint64
()
-
35
-
2
*
chainI
D
)
}
else
{
V
=
byte
(
dec
.
V
.
Uint64
()
-
27
)
}
...
...
@@ -192,10 +193,9 @@ func (tx *Transaction) CheckNonce() bool { return true }
func
(
tx
*
Transaction
)
To
()
*
common
.
Address
{
if
tx
.
data
.
Recipient
==
nil
{
return
nil
}
else
{
to
:=
*
tx
.
data
.
Recipient
return
&
to
}
to
:=
*
tx
.
data
.
Recipient
return
&
to
}
// Hash hashes the RLP encoding of tx.
...
...
@@ -315,22 +315,22 @@ func (tx *Transaction) String() string {
)
}
// Transaction slice type for basic sorting.
// Transaction
s is a Transaction
slice type for basic sorting.
type
Transactions
[]
*
Transaction
// Len returns the length of s
// Len returns the length of s
.
func
(
s
Transactions
)
Len
()
int
{
return
len
(
s
)
}
// Swap swaps the i'th and the j'th element in s
// Swap swaps the i'th and the j'th element in s
.
func
(
s
Transactions
)
Swap
(
i
,
j
int
)
{
s
[
i
],
s
[
j
]
=
s
[
j
],
s
[
i
]
}
// GetRlp implements Rlpable and returns the i'th element of s in rlp
// GetRlp implements Rlpable and returns the i'th element of s in rlp
.
func
(
s
Transactions
)
GetRlp
(
i
int
)
[]
byte
{
enc
,
_
:=
rlp
.
EncodeToBytes
(
s
[
i
])
return
enc
}
//
Returns a new set t which is the difference between a to b
//
TxDifference returns a new set t which is the difference between a to b.
func
TxDifference
(
a
,
b
Transactions
)
(
keep
Transactions
)
{
keep
=
make
(
Transactions
,
0
,
len
(
a
))
...
...
@@ -378,7 +378,7 @@ func (s *TxByPrice) Pop() interface{} {
}
// TransactionsByPriceAndNonce represents a set of transactions that can return
// transactions in a profit-maximi
s
ing sorted order, while supporting removing
// transactions in a profit-maximi
z
ing sorted order, while supporting removing
// entire batches of transactions for non-executable accounts.
type
TransactionsByPriceAndNonce
struct
{
txs
map
[
common
.
Address
]
Transactions
// Per account nonce-sorted list of transactions
...
...
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