diff --git a/db/l2db/apiqueries.go b/db/l2db/apiqueries.go index d86f403..937b9e1 100644 --- a/db/l2db/apiqueries.go +++ b/db/l2db/apiqueries.go @@ -128,6 +128,7 @@ func (l2db *L2DB) GetTxAPI(txID common.TxID) (*PoolTxAPI, error) { )) } +// GetPoolTxs return Txs from the pool func (l2db *L2DB) GetPoolTxs(idx *common.Idx, state *common.PoolL2TxState) ([]*PoolTxAPI, error) { cancel, err := l2db.apiConnCon.Acquire() defer cancel() @@ -154,7 +155,6 @@ func (l2db *L2DB) GetPoolTxs(idx *common.Idx, state *common.PoolL2TxState) ([]*P queryStr += "OR tx_pool.to_idx = ?) " args = append(args, idx) args = append(args, idx) - nextIsAnd = true } queryStr += "AND NOT external_delete;" query := l2db.dbRead.Rebind(queryStr) diff --git a/db/l2db/l2db_test.go b/db/l2db/l2db_test.go index 2a12107..4988990 100644 --- a/db/l2db/l2db_test.go +++ b/db/l2db/l2db_test.go @@ -317,6 +317,7 @@ func TestL2DB_GetPoolTxs(t *testing.T) { log.Error("Error prepare historyDB", err) } poolL2Txs, err := generatePoolL2Txs() + require.NoError(t, err) state := common.PoolL2TxState("pend") idx := common.Idx(256) var pendingTxs []*common.PoolL2Tx