Skip to content

Commit

Permalink
Merge pull request #11 from Alethio/database-connections-fix
Browse files Browse the repository at this point in the history
try to fix database connections
  • Loading branch information
kwix authored Feb 18, 2020
2 parents fa48d85 + 855b35e commit d6c9db3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/handlers_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ func (a *API) BlockRangeHandler(c *gin.Context) {
Error(c, err)
return
}
defer rows.Close()

var blockList = make([]map[string]interface{}, 0)

Expand Down
2 changes: 2 additions & 0 deletions api/handlers_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func (a *API) TxLogEntriesHandler(c *gin.Context) {
Error(c, err)
return
}
defer rows.Close()

var logEntries []types.LogEntry
for rows.Next() {
Expand Down Expand Up @@ -209,6 +210,7 @@ func (a *API) AccountTxsHandler(c *gin.Context) {
Error(c, err)
return
}
defer rows.Close()

var txs = make([]types.Tx, 0)
for rows.Next() {
Expand Down
1 change: 1 addition & 0 deletions api/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ func (a *API) getBlockTxs(number int64) ([]types.Tx, error) {
log.Error(err)
return nil, err
}
defer rows.Close()

for rows.Next() {
var (
Expand Down

0 comments on commit d6c9db3

Please sign in to comment.