From 987d57c05dae2b2627218a833183b3a4d1ca7455 Mon Sep 17 00:00:00 2001 From: Chris Schinnerl Date: Mon, 16 Dec 2024 15:09:16 +0100 Subject: [PATCH] fix panic in RecordContractRenewal --- stores/sql/chain.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stores/sql/chain.go b/stores/sql/chain.go index c872adfd0..35a91b9d0 100644 --- a/stores/sql/chain.go +++ b/stores/sql/chain.go @@ -214,11 +214,11 @@ func IsKnownContract(ctx context.Context, tx sql.Tx, fcid types.FileContractID) } func RecordContractRenewal(ctx context.Context, tx sql.Tx, oldFCID, newFCID types.FileContractID) error { - _, err := tx.Exec(ctx, "UPDATE contracts SET contracts.renewed_to = ? WHERE contracts.fcid = ?", FileContractID(newFCID), FileContractID(oldFCID)) + _, err := tx.Exec(ctx, "UPDATE contracts SET renewed_to = ? WHERE fcid = ?", FileContractID(newFCID), FileContractID(oldFCID)) if err != nil { return fmt.Errorf("failed to update renewed_to of old contract: %w", err) } - _, err = tx.Exec(ctx, "UPDATE contracts SET contracts.renewed_from = ? WHERE contracts.fcid = ?", FileContractID(oldFCID), FileContractID(newFCID)) + _, err = tx.Exec(ctx, "UPDATE contracts SET renewed_from = ? WHERE fcid = ?", FileContractID(oldFCID), FileContractID(newFCID)) if err != nil { return fmt.Errorf("failed to update renewed_from of new contract: %w", err) }