use rand.Int63n, remove underflow check, remove unnecessary cast

This commit is contained in:
Anton Kaliaev
2017-12-01 19:22:18 -06:00
parent 922af7c405
commit 10f7858453
4 changed files with 5 additions and 7 deletions

View File

@@ -88,8 +88,8 @@ func Tx(hash []byte, prove bool) (*ctypes.ResultTx, error) {
var proof types.TxProof
if prove {
// TODO: handle overflow
block := blockStore.LoadBlock(height)
// TODO: handle overflow
proof = block.Data.Txs.Proof(index)
}
@@ -187,8 +187,8 @@ func TxSearch(query string, prove bool) ([]*ctypes.ResultTx, error) {
index := r.Index
if prove {
// TODO: handle overflow
block := blockStore.LoadBlock(height)
// TODO: handle overflow
proof = block.Data.Txs.Proof(int(index))
}