core: fix typos in comment (#17531)
This commit is contained in:
parent
f236ac710e
commit
0bec85f2e2
@ -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 readt 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 {
|
|||||||
// 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 doens't exist at all
|
// Skip the parsing if the journal file doesn'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 {
|
|||||||
|
|
||||||
// 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
|
||||||
// journalled 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 {
|
|||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// New transaction parsed, queue up for later, import if threnshold 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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user