@@ -3,7 +3,7 @@ import { FullSynchronizer } from '../sync/fullsync'
3
3
import { EthProtocol } from '../net/protocol/ethprotocol'
4
4
import { LesProtocol } from '../net/protocol/lesprotocol'
5
5
import { Peer } from '../net/peer/peer'
6
- import { Protocol , BoundProtocol } from '../net/protocol'
6
+ import { Protocol } from '../net/protocol'
7
7
8
8
interface FullEthereumServiceOptions extends EthereumServiceOptions {
9
9
/* Serve LES requests (default: false) */
@@ -85,12 +85,12 @@ export class FullEthereumService extends EthereumService {
85
85
if ( message . name === 'GetBlockHeaders' ) {
86
86
const { block, max, skip, reverse } = message . data
87
87
const headers : any = await this . chain . getHeaders ( block , max , skip , reverse )
88
- ; ( peer . eth as BoundProtocol ) . send ( 'BlockHeaders' , headers )
88
+ peer . eth ! . send ( 'BlockHeaders' , headers )
89
89
} else if ( message . name === 'GetBlockBodies' ) {
90
90
const hashes = message . data
91
91
const blocks = await Promise . all ( hashes . map ( ( hash : any ) => this . chain . getBlock ( hash ) ) )
92
92
const bodies : any = blocks . map ( ( block : any ) => block . raw ( ) . slice ( 1 ) )
93
- ; ( peer . eth as BoundProtocol ) . send ( 'BlockBodies' , bodies )
93
+ peer . eth ! . send ( 'BlockBodies' , bodies )
94
94
} else if ( message . name === 'NewBlockHashes' ) {
95
95
await this . synchronizer . announced ( message . data , peer )
96
96
}
@@ -110,7 +110,7 @@ export class FullEthereumService extends EthereumService {
110
110
this . config . logger . debug ( `Dropping peer for violating flow control ${ peer } ` )
111
111
} else {
112
112
const headers : any = await this . chain . getHeaders ( block , max , skip , reverse )
113
- ; ( peer . les as BoundProtocol ) . send ( 'BlockHeaders' , { reqId, bv, headers } )
113
+ peer . les ! . send ( 'BlockHeaders' , { reqId, bv, headers } )
114
114
}
115
115
}
116
116
}
0 commit comments