celestiaorg / go-header

Go library with all the services needed to request, sync and store blockchain headers.
Apache License 2.0
17 stars 16 forks source link

refactor(p2p): simplify sendMessage #195

Closed cristaloleg closed 3 weeks ago

cristaloleg commented 3 weeks ago

Overview

sendMessage was doing a bit too much, observability could happen on the caller side, which easier to adapt and extend in the future.

Also, dropping 1 if in processResponses 'cause it's always false. And slice prealloc, looks harmless.