diff --git a/blockchain/reactor.go b/blockchain/reactor.go index 23d399426..2b334c232 100644 --- a/blockchain/reactor.go +++ b/blockchain/reactor.go @@ -72,18 +72,20 @@ func NewBlockchainReactor(state sm.State, blockExec *sm.BlockExecutor, store *Bl fastSync bool) *BlockchainReactor { if state.LastBlockHeight != store.Height() { - cmn.PanicSanity(cmn.Fmt("state (%v) and store (%v) height mismatch", state.LastBlockHeight, + panic(fmt.Sprintf("state (%v) and store (%v) height mismatch", state.LastBlockHeight, store.Height())) } const cap = 1000 // must be bigger than peers count requestsCh := make(chan BlockRequest, cap) errorsCh := make(chan peerError, cap) // so we don't block in #Receive#pool.AddBlock + pool := NewBlockPool( store.Height()+1, requestsCh, errorsCh, ) + bcR := &BlockchainReactor{ params: state.ConsensusParams, initialState: state, diff --git a/blockchain/store.go b/blockchain/store.go index a9a543436..b949bc904 100644 --- a/blockchain/store.go +++ b/blockchain/store.go @@ -76,7 +76,7 @@ func (bs *BlockStore) LoadBlock(height int64) *types.Block { } blockMeta := wire.ReadBinary(&types.BlockMeta{}, r, 0, &n, &err).(*types.BlockMeta) if err != nil { - cmn.PanicCrisis(cmn.Fmt("Error reading block meta: %v", err)) + panic(fmt.Sprintf("Error reading block meta: %v", err)) } bytez := []byte{} for i := 0; i < blockMeta.BlockID.PartsHeader.Total; i++ { @@ -85,7 +85,7 @@ func (bs *BlockStore) LoadBlock(height int64) *types.Block { } block := wire.ReadBinary(&types.Block{}, bytes.NewReader(bytez), 0, &n, &err).(*types.Block) if err != nil { - cmn.PanicCrisis(cmn.Fmt("Error reading block: %v", err)) + panic(fmt.Sprintf("Error reading block: %v", err)) } return block } @@ -102,7 +102,7 @@ func (bs *BlockStore) LoadBlockPart(height int64, index int) *types.Part { } part := wire.ReadBinary(&types.Part{}, r, 0, &n, &err).(*types.Part) if err != nil { - cmn.PanicCrisis(cmn.Fmt("Error reading block part: %v", err)) + panic(fmt.Sprintf("Error reading block part: %v", err)) } return part } @@ -118,7 +118,7 @@ func (bs *BlockStore) LoadBlockMeta(height int64) *types.BlockMeta { } blockMeta := wire.ReadBinary(&types.BlockMeta{}, r, 0, &n, &err).(*types.BlockMeta) if err != nil { - cmn.PanicCrisis(cmn.Fmt("Error reading block meta: %v", err)) + panic(fmt.Sprintf("Error reading block meta: %v", err)) } return blockMeta } @@ -136,7 +136,7 @@ func (bs *BlockStore) LoadBlockCommit(height int64) *types.Commit { } commit := wire.ReadBinary(&types.Commit{}, r, 0, &n, &err).(*types.Commit) if err != nil { - cmn.PanicCrisis(cmn.Fmt("Error reading commit: %v", err)) + panic(fmt.Sprintf("Error reading commit: %v", err)) } return commit } @@ -153,7 +153,7 @@ func (bs *BlockStore) LoadSeenCommit(height int64) *types.Commit { } commit := wire.ReadBinary(&types.Commit{}, r, 0, &n, &err).(*types.Commit) if err != nil { - cmn.PanicCrisis(cmn.Fmt("Error reading commit: %v", err)) + panic(fmt.Sprintf("Error reading commit: %v", err)) } return commit } @@ -262,7 +262,7 @@ func LoadBlockStoreStateJSON(db dbm.DB) BlockStoreStateJSON { bsj := BlockStoreStateJSON{} err := json.Unmarshal(bytes, &bsj) if err != nil { - cmn.PanicCrisis(cmn.Fmt("Could not unmarshal bytes: %X", bytes)) + panic(fmt.Sprintf("Could not unmarshal bytes: %X", bytes)) } return bsj }