Skip to content

Commit

Permalink
sqlite: remove extra join in expiredContractSectors
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed Aug 10, 2023
1 parent 4d56c78 commit 3fc5f2a
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion persist/sqlite/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,6 @@ func setContractStatus(tx txn, id types.FileContractID, status contracts.Contrac
func expiredContractSectors(tx txn, height uint64, batchSize int64) (sectors []contractSectorRef, _ error) {
const query = `SELECT csr.id, c.contract_id FROM contract_sector_roots csr
INNER JOIN contracts c ON (csr.contract_id=c.id)
INNER JOIN stored_sectors s ON (csr.sector_id = s.id)
-- past proof window or not confirmed and past the rebroadcast height
WHERE c.window_end < $1 OR c.contract_status=$2 LIMIT $3;`
rows, err := tx.Query(query, height, contracts.ContractStatusRejected, batchSize)
Expand Down

0 comments on commit 3fc5f2a

Please sign in to comment.