|
@ -76,7 +76,7 @@ func (bs *BlockStore) LoadBlock(height int64) *types.Block { |
|
|
} |
|
|
} |
|
|
blockMeta := wire.ReadBinary(&types.BlockMeta{}, r, 0, &n, &err).(*types.BlockMeta) |
|
|
blockMeta := wire.ReadBinary(&types.BlockMeta{}, r, 0, &n, &err).(*types.BlockMeta) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
cmn.PanicCrisis(cmn.Fmt("Error reading block meta: %v", err)) |
|
|
|
|
|
|
|
|
panic(fmt.Sprintf("Error reading block meta: %v", err)) |
|
|
} |
|
|
} |
|
|
bytez := []byte{} |
|
|
bytez := []byte{} |
|
|
for i := 0; i < blockMeta.BlockID.PartsHeader.Total; i++ { |
|
|
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) |
|
|
block := wire.ReadBinary(&types.Block{}, bytes.NewReader(bytez), 0, &n, &err).(*types.Block) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
cmn.PanicCrisis(cmn.Fmt("Error reading block: %v", err)) |
|
|
|
|
|
|
|
|
panic(fmt.Sprintf("Error reading block: %v", err)) |
|
|
} |
|
|
} |
|
|
return block |
|
|
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) |
|
|
part := wire.ReadBinary(&types.Part{}, r, 0, &n, &err).(*types.Part) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
cmn.PanicCrisis(cmn.Fmt("Error reading block part: %v", err)) |
|
|
|
|
|
|
|
|
panic(fmt.Sprintf("Error reading block part: %v", err)) |
|
|
} |
|
|
} |
|
|
return part |
|
|
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) |
|
|
blockMeta := wire.ReadBinary(&types.BlockMeta{}, r, 0, &n, &err).(*types.BlockMeta) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
cmn.PanicCrisis(cmn.Fmt("Error reading block meta: %v", err)) |
|
|
|
|
|
|
|
|
panic(fmt.Sprintf("Error reading block meta: %v", err)) |
|
|
} |
|
|
} |
|
|
return blockMeta |
|
|
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) |
|
|
commit := wire.ReadBinary(&types.Commit{}, r, 0, &n, &err).(*types.Commit) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
cmn.PanicCrisis(cmn.Fmt("Error reading commit: %v", err)) |
|
|
|
|
|
|
|
|
panic(fmt.Sprintf("Error reading commit: %v", err)) |
|
|
} |
|
|
} |
|
|
return commit |
|
|
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) |
|
|
commit := wire.ReadBinary(&types.Commit{}, r, 0, &n, &err).(*types.Commit) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
cmn.PanicCrisis(cmn.Fmt("Error reading commit: %v", err)) |
|
|
|
|
|
|
|
|
panic(fmt.Sprintf("Error reading commit: %v", err)) |
|
|
} |
|
|
} |
|
|
return commit |
|
|
return commit |
|
|
} |
|
|
} |
|
@ -262,7 +262,7 @@ func LoadBlockStoreStateJSON(db dbm.DB) BlockStoreStateJSON { |
|
|
bsj := BlockStoreStateJSON{} |
|
|
bsj := BlockStoreStateJSON{} |
|
|
err := json.Unmarshal(bytes, &bsj) |
|
|
err := json.Unmarshal(bytes, &bsj) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
cmn.PanicCrisis(cmn.Fmt("Could not unmarshal bytes: %X", bytes)) |
|
|
|
|
|
|
|
|
panic(fmt.Sprintf("Could not unmarshal bytes: %X", bytes)) |
|
|
} |
|
|
} |
|
|
return bsj |
|
|
return bsj |
|
|
} |
|
|
} |