Skip to content

Reduce the number of unnecessary block broadcasts

Christopher Schinnerl requested to merge VoidingWarranties:limit-broadcast into master

Created by: VoidingWarranties

It is only necessary to broadcast the last block in a chain of calls to AcceptBlock. This commit changes the behavior of threadedReceiveBlocks to only broadcast the last block received. This is especially helpful during the initial blockchain download. Instead of rebroadcasting every block, only the last block in the initial blockchain download is broadcasted.

Here's the gateway log after an initial blockchain download. Only one RelayBlock broadcast :)

$ cat gateway.log | grep RelayBlock
2016/02/04 17:32:26.716491 rpc.go:133: INFO: broadcasting RPC "RelayBlock" to 8 peers

Merge request reports