Skip to content

Commit 0df1e9c

Browse files
committed
commands/p2p: use cmds.EmitOnce in single value
License: MIT Signed-off-by: Overbool <[email protected]>
1 parent 52154e9 commit 0df1e9c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/commands/p2p.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ var p2pLsCmd = &cmds.Command{
310310
}
311311
n.P2P.ListenersP2P.Unlock()
312312

313-
return res.Emit(output)
313+
return cmds.EmitOnce(res, output)
314314
},
315315
Type: P2PLsOutput{},
316316
Encoders: cmds.EncoderMap{
@@ -398,7 +398,7 @@ var p2pCloseCmd = &cmds.Command{
398398
done := n.P2P.ListenersLocal.Close(match)
399399
done += n.P2P.ListenersP2P.Close(match)
400400

401-
return res.Emit(done)
401+
return cmds.EmitOnce(res, done)
402402
},
403403
Type: int(0),
404404
Encoders: cmds.EncoderMap{
@@ -454,7 +454,7 @@ var p2pStreamLsCmd = &cmds.Command{
454454
}
455455
n.P2P.Streams.Unlock()
456456

457-
return res.Emit(output)
457+
return cmds.EmitOnce(res, output)
458458
},
459459
Type: P2PStreamsOutput{},
460460
Encoders: cmds.EncoderMap{

0 commit comments

Comments
 (0)