This repository was archived by the owner on Nov 9, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -408,27 +408,27 @@ export class JsonRpcEngine extends SafeEventEmitter {
408408 returnHandler ?: JsonRpcEngineReturnHandler ,
409409 ) => {
410410 if ( res . error ) {
411- end ( res . error ) ;
412- } else {
413- if ( returnHandler ) {
414- if ( typeof returnHandler !== 'function' ) {
415- end (
416- new EthereumRpcError (
417- errorCodes . rpc . internal ,
418- `JsonRpcEngine: "next" return handlers must be functions. ` +
419- `Received "${ typeof returnHandler } " for request:\n${ jsonify (
420- req ,
421- ) } `,
422- { request : req } ,
423- ) ,
424- ) ;
425- }
426- returnHandlers . push ( returnHandler ) ;
427- }
411+ return end ( res . error ) ;
412+ }
428413
429- // False indicates that the request should not end
430- resolve ( [ null , false ] ) ;
414+ if ( returnHandler ) {
415+ if ( typeof returnHandler !== 'function' ) {
416+ return end (
417+ new EthereumRpcError (
418+ errorCodes . rpc . internal ,
419+ `JsonRpcEngine: "next" return handlers must be functions. ` +
420+ `Received "${ typeof returnHandler } " for request:\n${ jsonify (
421+ req ,
422+ ) } `,
423+ { request : req } ,
424+ ) ,
425+ ) ;
426+ }
427+ returnHandlers . push ( returnHandler ) ;
431428 }
429+
430+ // False indicates that the request should not end
431+ return resolve ( [ null , false ] ) ;
432432 } ;
433433
434434 try {
You can’t perform that action at this time.
0 commit comments