@@ -149,9 +149,7 @@ func (d *MetadataStoreSqlite) SetPoolRegistration(
149149 }
150150 tmpPool , err := d .GetPool (cert .Operator [:], txn )
151151 if err != nil {
152- if errors .Is (err , models .ErrPoolNotFound ) {
153- // Do nothing :-)
154- } else {
152+ if ! errors .Is (err , models .ErrPoolNotFound ) {
155153 return err
156154 }
157155 }
@@ -202,11 +200,11 @@ func (d *MetadataStoreSqlite) SetPoolRegistration(
202200 }
203201 tmpPool .Registration = append (tmpPool .Registration , tmpReg )
204202 tmpPool .Relays = tmpReg .Relays
205- onConflict := clause.OnConflict {
203+ // d.logger.Debug("pool registration", "hash", tmpReg.PoolKeyHash)
204+ result := txn .Clauses (clause.OnConflict {
206205 Columns : []clause.Column {{Name : "pool_key_hash" }},
207206 UpdateAll : true ,
208- }
209- result := txn .Clauses (onConflict ).Create (& tmpPool )
207+ }).Create (& tmpPool )
210208 if result .Error != nil {
211209 return result .Error
212210 }
@@ -227,7 +225,9 @@ func (d *MetadataStoreSqlite) SetPoolRetirement(
227225 return err
228226 }
229227 if tmpPool == nil {
230- return models .ErrPoolNotFound
228+ d .logger .Warn ("retiring non-existent pool" , "hash" , cert .PoolKeyHash )
229+ tmpPool = & models.Pool {PoolKeyHash : cert .PoolKeyHash [:]}
230+ // return models.ErrPoolNotFound
231231 }
232232 tmpItem := models.PoolRetirement {
233233 PoolKeyHash : cert .PoolKeyHash [:],
0 commit comments