diff --git a/storage/sqlite3.go b/storage/sqlite3.go index 2ec88d4..9c16689 100644 --- a/storage/sqlite3.go +++ b/storage/sqlite3.go @@ -122,8 +122,7 @@ func GetBlockRange(ctx context.Context, db *sql.DB, blockOut chan<- []byte, errO } func StoreBlock(conn *sql.DB, height int, hash string, sapling bool, encoded []byte) error { - insertBlock := "INSERT INTO blocks (block_height, block_hash, sapling, compact_encoding) values (?, ?, ?, ?)" - + insertBlock := "REPLACE INTO blocks (block_height, block_hash, sapling, compact_encoding) values (?, ?, ?, ?)" tx, err := conn.Begin() if err != nil { return errors.Wrap(err, fmt.Sprintf("creating db tx %d", height))