Browse Source

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
pull/4691/head
Erik Grinaker 4 years ago
committed by GitHub
parent
commit
ee9545e971
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      blockchain/v2/io.go

+ 3
- 0
blockchain/v2/io.go 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,


Loading…
Cancel
Save