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
0bec85f2
Commit
0bec85f2
authored
Aug 28, 2018
by
Sheldon
Committed by
Péter Szilágyi
Aug 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fix typos in comment (#17531)
parent
f236ac71
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
tx_journal.go
core/tx_journal.go
+4
-4
No files found.
core/tx_journal.go
View file @
0bec85f2
...
@@ -34,7 +34,7 @@ var errNoActiveJournal = errors.New("no active journal")
...
@@ -34,7 +34,7 @@ var errNoActiveJournal = errors.New("no active journal")
// devNull is a WriteCloser that just discards anything written into it. Its
// devNull is a WriteCloser that just discards anything written into it. Its
// goal is to allow the transaction journal to write into a fake journal when
// goal is to allow the transaction journal to write into a fake journal when
// loading transactions on startup without printing warnings due to no file
// loading transactions on startup without printing warnings due to no file
// being read
t
for write.
// being read for write.
type
devNull
struct
{}
type
devNull
struct
{}
func
(
*
devNull
)
Write
(
p
[]
byte
)
(
n
int
,
err
error
)
{
return
len
(
p
),
nil
}
func
(
*
devNull
)
Write
(
p
[]
byte
)
(
n
int
,
err
error
)
{
return
len
(
p
),
nil
}
...
@@ -57,7 +57,7 @@ func newTxJournal(path string) *txJournal {
...
@@ -57,7 +57,7 @@ func newTxJournal(path string) *txJournal {
// load parses a transaction journal dump from disk, loading its contents into
// load parses a transaction journal dump from disk, loading its contents into
// the specified pool.
// the specified pool.
func
(
journal
*
txJournal
)
load
(
add
func
([]
*
types
.
Transaction
)
[]
error
)
error
{
func
(
journal
*
txJournal
)
load
(
add
func
([]
*
types
.
Transaction
)
[]
error
)
error
{
// Skip the parsing if the journal file doe
ns
't exist at all
// Skip the parsing if the journal file doe
sn
't exist at all
if
_
,
err
:=
os
.
Stat
(
journal
.
path
);
os
.
IsNotExist
(
err
)
{
if
_
,
err
:=
os
.
Stat
(
journal
.
path
);
os
.
IsNotExist
(
err
)
{
return
nil
return
nil
}
}
...
@@ -78,7 +78,7 @@ func (journal *txJournal) load(add func([]*types.Transaction) []error) error {
...
@@ -78,7 +78,7 @@ func (journal *txJournal) load(add func([]*types.Transaction) []error) error {
// Create a method to load a limited batch of transactions and bump the
// Create a method to load a limited batch of transactions and bump the
// appropriate progress counters. Then use this method to load all the
// appropriate progress counters. Then use this method to load all the
// journal
l
ed transactions in small-ish batches.
// journaled transactions in small-ish batches.
loadBatch
:=
func
(
txs
types
.
Transactions
)
{
loadBatch
:=
func
(
txs
types
.
Transactions
)
{
for
_
,
err
:=
range
add
(
txs
)
{
for
_
,
err
:=
range
add
(
txs
)
{
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -103,7 +103,7 @@ func (journal *txJournal) load(add func([]*types.Transaction) []error) error {
...
@@ -103,7 +103,7 @@ func (journal *txJournal) load(add func([]*types.Transaction) []error) error {
}
}
break
break
}
}
// New transaction parsed, queue up for later, import if thre
n
shold is reached
// New transaction parsed, queue up for later, import if threshold is reached
total
++
total
++
if
batch
=
append
(
batch
,
tx
);
batch
.
Len
()
>
1024
{
if
batch
=
append
(
batch
,
tx
);
batch
.
Len
()
>
1024
{
...
...
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