blockchain/v2: don't broadcast base if height is 0

## Description

Fixes a bug where the reactor would broadcast a base with height=0.

______

For contributor use:

- [ ] Wrote tests
- [ ] Updated CHANGELOG_PENDING.md
- [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
- [ ] Updated relevant documentation (`docs/`) and code comments
- [x] Re-reviewed `Files changed` in the Github PR explorer
This commit is contained in:
Erik Grinaker
2020-04-16 13:33:59 +02:00
committed by GitHub
parent cadcbb2bf5
commit ee9545e971

View File

@@ -105,6 +105,9 @@ func (sio *switchIO) trySwitchToConsensus(state state.State, blocksSynced int) {
}
func (sio *switchIO) broadcastStatusRequest(base int64, height int64) {
if height == 0 && base > 0 {
base = 0
}
msgBytes := cdc.MustMarshalBinaryBare(&bcStatusRequestMessage{
Base: base,
Height: height,