From 141a291ec62c8e948f7b0cf0b662bed4582d7e8d Mon Sep 17 00:00:00 2001 From: Christopher Tarry Date: Fri, 4 Oct 2024 13:52:11 -0400 Subject: [PATCH] fix bug where confirmation/proof index were not set for all but the latest revision of a contract --- persist/sqlite/contracts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/persist/sqlite/contracts.go b/persist/sqlite/contracts.go index fbd2e3de..c9975753 100644 --- a/persist/sqlite/contracts.go +++ b/persist/sqlite/contracts.go @@ -86,7 +86,7 @@ func (s *Store) ContractRevisions(id types.FileContractID) (revisions []explorer err = s.transaction(func(tx *txn) error { query := `SELECT fc.id, fc.contract_id, fc.leaf_index, fc.resolved, fc.valid, rev.confirmation_index, rev.confirmation_transaction_id, rev.proof_index, rev.proof_transaction_id, fc.filesize, fc.file_merkle_root, fc.window_start, fc.window_end, fc.payout, fc.unlock_hash, fc.revision_number FROM file_contract_elements fc - LEFT JOIN last_contract_revision rev ON (rev.contract_element_id = fc.id) + JOIN last_contract_revision rev ON (rev.contract_id = fc.contract_id) WHERE fc.contract_id = ? ORDER BY fc.revision_number ASC` rows, err := tx.Query(query, encode(id))