Skip to content

Commit 4f846c0

Browse files
jochem-brouwerholgerd77
authored andcommitted
client: fix small comments on fetcher
1 parent bc6133f commit 4f846c0

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

packages/client/lib/net/protocol/ethprotocol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { BN, bufferToInt } from 'ethereumjs-util'
22
import { BlockHeader, BlockHeaderBuffer } from '@ethereumjs/block'
33
import { Chain } from './../../blockchain'
44
import { Message, Protocol, ProtocolOptions } from './protocol'
5-
import { BlockBodyBuffer } from '../../../../block/dist'
5+
import { BlockBodyBuffer } from '@ethereumjs/block'
66

77
interface EthProtocolOptions extends ProtocolOptions {
88
/* Blockchain */

packages/client/lib/sync/fetcher/headerfetcher.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,13 @@ export class HeaderFetcher extends BlockFetcherBase<BlockHeaderResult, BlockHead
3737
const { task, peer } = job
3838
if (this.flow.maxRequestCount(peer!, 'GetBlockHeaders') < this.maxPerRequest) {
3939
// we reached our request limit. try with a different peer.
40-
return undefined
40+
return
4141
}
4242
const response = await (peer!.les as LesProtocolMethods).getBlockHeaders({
4343
block: task.first,
4444
max: task.count,
4545
})
46-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
47-
if (response) {
48-
return response
49-
}
50-
return undefined
46+
return response
5147
}
5248

5349
/**

0 commit comments

Comments
 (0)