@@ -18,8 +18,8 @@ type Transaction struct {
1818 TxIndex int `db:"tx_index" json:"index"` // pk2
1919 Hash string `db:"hash" json:"hash"`
2020 BlockHash string `db:"block_hash" json:"block_hash"`
21- Timestamp int64 `db:"timestamp" json:"- "`
22- TimestampHuman time.Time `db:"-" json:"timestamp "`
21+ Timestamp int64 `db:"timestamp" json:"timestamp "`
22+ TimestampHuman time.Time `db:"-" json:"timestamp_human "`
2323 TxType int `db:"tx_type" json:"type"`
2424 Address string `db:"address" json:"address"`
2525 Raw string `db:"raw" json:"raw"`
@@ -64,10 +64,10 @@ func (m *TransactionsModel) GetTransactionList(since, direction string, limit in
6464 query := fmt .Sprintf (`SELECT block_height, tx_index, hash, block_hash,
6565 timestamp, tx_type, address, raw
6666 FROM indexed_transactions
67- WHERE block_height %s ? and tx_index %s ?
67+ WHERE block_height %s ? or (block_height = ? and tx_index %s ?)
6868 ORDER BY block_height %s, tx_index %s
6969 LIMIT ?` , compare , compare , orderBy , orderBy )
7070
71- _ , err = chaindb .Select (& txs , query , tx .BlockHeight , tx .TxIndex , limit )
71+ _ , err = chaindb .Select (& txs , query , tx .BlockHeight , tx .BlockHeight , tx . TxIndex , limit )
7272 return txs , err
7373}
0 commit comments